Flashplayer

koos vriezen koos.vriezen at gmail.com
Sat Oct 20 11:53:05 BST 2007


void ScriptExportEngine::unregister(const unsigned long objid)
+{
+    //See if this is an object identifier..
+    QMap<unsigned long, NPObject*>::iterator i = _objectsForId.find(objid);
+    if (i != _objectsForId.end()) {
+        NPObject* obj = *i;
+        //Is this the last reference?
+        if (obj->referenceCount == 1) {
+            _objectsForId.remove(objid);
+            _objectIds.remove(obj);
+        }
+
+        g_NPN_ReleaseObject(obj);
+        return;
+    }

Btw, this is a memory leak. Likely the NPObject has ref count > 0 as
it's an object inside the plugin, but since js counter part object is
deleted, you should always remove it from your object list.

Br,
Koos




More information about the kfm-devel mailing list