Merge pull request #1329 in FS/freeswitch from ~ANDYWOLK/freeswitch:bugfix/FS-10488-fix-memory-leak to master
* commit '28913d27645d392abd41e6db5be0d6f26278960e': FS-10488: [mod_v8] Fix memory leak.
This commit is contained in:
commit
c1b3369978
|
@ -655,7 +655,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
|
||||||
}
|
}
|
||||||
// Create a string containing the JavaScript source code.
|
// Create a string containing the JavaScript source code.
|
||||||
#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
|
#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
|
||||||
ScriptCompiler::Source *source = new ScriptCompiler::Source(String::NewFromUtf8(isolate, script_data));
|
ScriptCompiler::Source source(String::NewFromUtf8(isolate, script_data));
|
||||||
#else
|
#else
|
||||||
Handle<String> source = String::NewFromUtf8(isolate, script_data);
|
Handle<String> source = String::NewFromUtf8(isolate, script_data);
|
||||||
#endif
|
#endif
|
||||||
|
@ -665,7 +665,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
|
||||||
// Compile the source code.
|
// Compile the source code.
|
||||||
#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
|
#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
|
||||||
v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions;
|
v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions;
|
||||||
Handle<v8::Script> v8_script = v8::ScriptCompiler::Compile(context, source, options).ToLocalChecked();
|
Handle<v8::Script> v8_script = v8::ScriptCompiler::Compile(context, &source, options).ToLocalChecked();
|
||||||
//Handle<v8::Script> v8_script = v8::ScriptCompiler::Compile(context, source,/* String::NewFromUtf8(isolate, script_file),*/ v8::ScriptCompiler::kProduceCodeCache).ToLocalChecked();
|
//Handle<v8::Script> v8_script = v8::ScriptCompiler::Compile(context, source,/* String::NewFromUtf8(isolate, script_file),*/ v8::ScriptCompiler::kProduceCodeCache).ToLocalChecked();
|
||||||
//source->GetCachedData();
|
//source->GetCachedData();
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue