Fix a leak with g_DefaultGlobalObjectTemplate.
authorLei Zhang <thestig@chromium.org>
Mon, 5 Oct 2015 03:42:33 +0000 (20:42 -0700)
committerLei Zhang <thestig@chromium.org>
Mon, 5 Oct 2015 03:42:33 +0000 (20:42 -0700)
As seen when running FXJSV8Embeddertest.Getters.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1380993003 .

fpdfsdk/src/jsapi/fxjs_v8.cpp

index 54044e2..70cdc2d 100644 (file)
@@ -145,6 +145,7 @@ void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate* pIsolate) {
 
 void FXJS_Release() {
   ASSERT(!g_isolate || g_isolate_ref_count == 0);
+  delete g_DefaultGlobalObjectTemplate;
   g_DefaultGlobalObjectTemplate = nullptr;
   g_isolate = nullptr;