fix firefox crash on osx

This commit is contained in:
David Rose
2009-08-08 02:20:39 +00:00
parent 5b84a46753
commit c1fea52cab
5 changed files with 22 additions and 0 deletions

View File

@@ -738,6 +738,10 @@ start_p3dpython() {
env += _python_root_dir;
env += '\0';
env += "PYTHONHOME=";
env += _python_root_dir;
env += '\0';
env += "PRC_DIR=";
env += _python_root_dir;
env += '\0';
@@ -746,6 +750,7 @@ start_p3dpython() {
env += _python_root_dir;
env += '\0';
nout << "Attempting to start python from " << p3dpython << "\n";
#ifdef _WIN32
_p3dpython_handle = win_create_process
(p3dpython, _python_root_dir, env, _output_filename,

View File

@@ -246,6 +246,18 @@ eval(const string &expression) const {
return object;
}
////////////////////////////////////////////////////////////////////
// Function: PPBrowserObject::clear_class_definition
// Access: Public, Static
// Description: Should be called when the core API is unloaded, and
// the associated class definition object is therefore
// invalidated.
////////////////////////////////////////////////////////////////////
void PPBrowserObject::
clear_class_definition() {
_browser_object_class = NULL;
}
////////////////////////////////////////////////////////////////////
// Function: PPBrowserObject::get_class_definition
// Access: Private, Static

View File

@@ -43,6 +43,8 @@ public:
P3D_object *params[], int num_params) const;
P3D_object *eval(const string &expression) const;
static void clear_class_definition();
private:
static P3D_class_definition *get_class_definition();

View File

@@ -932,6 +932,7 @@ do_load_plugin() {
}
#endif // P3D_PLUGIN_P3D_PLUGIN
nout << "Attempting to load core API from " << pathname << "\n";
if (!load_plugin(pathname, "", "", "")) {
nout << "Unable to launch core API in " << pathname << "\n";
return;

View File

@@ -15,6 +15,7 @@
#include "startup.h"
#include "p3d_plugin_config.h"
#include "p3d_lock.h"
#include "ppBrowserObject.h"
#ifdef _WIN32
#include <malloc.h>
@@ -183,6 +184,7 @@ NPError OSCALL
NP_Shutdown(void) {
nout << "shutdown\n";
unload_plugin();
PPBrowserObject::clear_class_definition();
// Not clear whether there's a return value or not. Some versions
// of the API have different opinions on this.