Skip to content

Commit a0e762c

Browse files
author
Grace Kloba
committed
free the NPObject in NPP_Destroy.
1 parent 3bc69e6 commit a0e762c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

samples/BrowserPlugin/jni/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
245245
NPError NPP_Destroy(NPP instance, NPSavedData** save)
246246
{
247247
PluginObject *obj = (PluginObject*) instance->pdata;
248-
delete obj->activePlugin;
248+
if (obj) {
249+
delete obj->activePlugin;
250+
browser->releaseobject(&obj->header);
251+
}
249252

250253
return NPERR_NO_ERROR;
251254
}

0 commit comments

Comments
 (0)