Index: src/JsEngine.cpp |
=================================================================== |
--- a/src/JsEngine.cpp |
+++ b/src/JsEngine.cpp |
@@ -42,28 +42,27 @@ |
class V8Initializer |
{ |
V8Initializer() |
: platform{nullptr} |
{ |
std::string cmd = "--use_strict"; |
v8::V8::SetFlagsFromString(cmd.c_str(), cmd.length()); |
- platform = v8::platform::CreateDefaultPlatform(); |
- v8::V8::InitializePlatform(platform); |
+ platform = v8::platform::NewDefaultPlatform(); |
+ v8::V8::InitializePlatform(platform.get()); |
v8::V8::Initialize(); |
} |
~V8Initializer() |
{ |
v8::V8::Dispose(); |
v8::V8::ShutdownPlatform(); |
- delete platform; |
} |
- v8::Platform* platform; |
+ std::unique_ptr<v8::Platform> platform; |
public: |
static void Init() |
{ |
// it's threadsafe since C++11 and it will be instantiated only once and |
// destroyed at the application exit |
static V8Initializer initializer; |
} |
}; |