Browse Source

removed unnecessary JSV8Env && V8::Dispose in libjsengine

cl-refactor
unknown 10 years ago
parent
commit
944dd16825
  1. 17
      libjsengine/JSV8Engine.cpp
  2. 1
      libjsengine/JSV8Engine.h

17
libjsengine/JSV8Engine.cpp

@ -91,21 +91,6 @@ void reportException(v8::TryCatch* _tryCatch)
}
}
class JSV8Env
{
public:
static JSV8Env& getInstance()
{
static JSV8Env s_env;
return s_env;
}
~JSV8Env()
{
v8::V8::Dispose();
}
};
class JSV8Scope
{
public:
@ -146,7 +131,7 @@ JSString JSV8Value::toString() const
return toCString(str);
}
JSV8Engine::JSV8Engine(): m_env(JSV8Env::getInstance()), m_scope(new JSV8Scope())
JSV8Engine::JSV8Engine(): m_scope(new JSV8Scope())
{
JSEngineResources resources;
eval("env = typeof(env) === 'undefined' ? {} : env; env.os = '" TO_STRING(ETH_BUILD_PLATFORM) "'");

1
libjsengine/JSV8Engine.h

@ -56,7 +56,6 @@ public:
v8::Handle<v8::Context> const& context() const;
private:
JSV8Env const& m_env;
JSV8Scope* m_scope;
};

Loading…
Cancel
Save