fix crash on exit

This commit is contained in:
David Rose 2009-07-07 19:23:12 +00:00
parent 7f7c3fe373
commit 7a00a8cab0
2 changed files with 8 additions and 3 deletions

View File

@ -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();
}

View File

@ -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;
}