From 7a00a8cab07d2e209d574defa68ceda23ff4751c Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 7 Jul 2009 19:23:12 +0000 Subject: [PATCH] fix crash on exit --- direct/src/plugin/load_plugin.cxx | 3 --- direct/src/plugin_npapi/ppInstance.cxx | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/direct/src/plugin/load_plugin.cxx b/direct/src/plugin/load_plugin.cxx index ba1ecc28c6..75e35d3c0b 100755 --- a/direct/src/plugin/load_plugin.cxx +++ b/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(); } diff --git a/direct/src/plugin_npapi/ppInstance.cxx b/direct/src/plugin_npapi/ppInstance.cxx index 4d0793abf8..44882465e0 100644 --- a/direct/src/plugin_npapi/ppInstance.cxx +++ b/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; }