Bläddra i källkod

fix crash on exit

David Rose 16 år sedan
förälder
incheckning
7a00a8cab0
2 ändrade filer med 8 tillägg och 3 borttagningar
  1. 0 3
      direct/src/plugin/load_plugin.cxx
  2. 8 0
      direct/src/plugin_npapi/ppInstance.cxx

+ 0 - 3
direct/src/plugin/load_plugin.cxx

@@ -261,9 +261,6 @@ unload_plugin() {
   cerr << "unload_plugin called\n";
 
   P3D_finalize();
-
-  // TODO: unloading the DLL causes crashy problems on Windows.  Must
-  // be an outstanding pointer or two still uncleaned-up.
   unload_dso();
 }
 

+ 8 - 0
direct/src/plugin_npapi/ppInstance.cxx

@@ -82,9 +82,13 @@ PPInstance::
     _p3d_inst = NULL;
   }
 
+  // It's not clear why we shoudn't release this object now, but if we
+  // do we crash (at least on Windows).
+  /*
   if (_script_object != NULL) {
     browser->releaseobject(_script_object);
   }
+  */
 
   // Free the tokens we allocated.
   Tokens::iterator ti;
@@ -468,7 +472,11 @@ get_panda_script_object() {
   }
 
   _script_object = PPPandaObject::make_new(this, obj);
+
+  // It's not clear why we need to explicitly retain this object now,
+  // but if we don't we crash.
   browser->retainobject(_script_object);
+
   return _script_object;
 }