Clean up node environment on exit in main process
This commit is contained in:
parent
d009b3267a
commit
a0605275b9
4 changed files with 29 additions and 0 deletions
|
@ -8,8 +8,13 @@
|
|||
#include "base/macros.h"
|
||||
#include "gin/public/isolate_holder.h"
|
||||
|
||||
namespace node {
|
||||
class Environment;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
|
||||
// Manage the V8 isolate and context automatically.
|
||||
class JavascriptEnvironment {
|
||||
public:
|
||||
JavascriptEnvironment();
|
||||
|
@ -37,6 +42,18 @@ class JavascriptEnvironment {
|
|||
DISALLOW_COPY_AND_ASSIGN(JavascriptEnvironment);
|
||||
};
|
||||
|
||||
// Manage the Node Environment automatically.
|
||||
class NodeEnvironment {
|
||||
public:
|
||||
NodeEnvironment(node::Environment* env);
|
||||
~NodeEnvironment();
|
||||
|
||||
private:
|
||||
node::Environment* env_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NodeEnvironment);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_JAVASCRIPT_ENVIRONMENT_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue