From c782c8d3277f1ee627b7d9b70eab27e956b78c98 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Sun, 27 Dec 2009 14:38:14 -0800 Subject: [PATCH] free the NPObject in NPP_Destroy. --- tests/BrowserTestPlugin/jni/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/BrowserTestPlugin/jni/main.cpp b/tests/BrowserTestPlugin/jni/main.cpp index c896ad566942f..586d139446b62 100644 --- a/tests/BrowserTestPlugin/jni/main.cpp +++ b/tests/BrowserTestPlugin/jni/main.cpp @@ -168,7 +168,10 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, NPError NPP_Destroy(NPP instance, NPSavedData** save) { PluginObject *obj = (PluginObject*) instance->pdata; - delete obj->subPlugin; + if (obj) { + delete obj->subPlugin; + browser->releaseobject(&obj->header); + } return NPERR_NO_ERROR; }