diff --git a/direct/src/plugin/p3dSession.cxx b/direct/src/plugin/p3dSession.cxx index fb42d3b3aa..f19a6d9425 100644 --- a/direct/src/plugin/p3dSession.cxx +++ b/direct/src/plugin/p3dSession.cxx @@ -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, diff --git a/direct/src/plugin_npapi/ppBrowserObject.cxx b/direct/src/plugin_npapi/ppBrowserObject.cxx index 3beee31098..038d392553 100644 --- a/direct/src/plugin_npapi/ppBrowserObject.cxx +++ b/direct/src/plugin_npapi/ppBrowserObject.cxx @@ -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 diff --git a/direct/src/plugin_npapi/ppBrowserObject.h b/direct/src/plugin_npapi/ppBrowserObject.h index 46244d8b06..d18d221f07 100644 --- a/direct/src/plugin_npapi/ppBrowserObject.h +++ b/direct/src/plugin_npapi/ppBrowserObject.h @@ -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(); diff --git a/direct/src/plugin_npapi/ppInstance.cxx b/direct/src/plugin_npapi/ppInstance.cxx index 8c394ac136..eadaa2f6e4 100644 --- a/direct/src/plugin_npapi/ppInstance.cxx +++ b/direct/src/plugin_npapi/ppInstance.cxx @@ -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; diff --git a/direct/src/plugin_npapi/startup.cxx b/direct/src/plugin_npapi/startup.cxx index a70722d785..8bad17464e 100644 --- a/direct/src/plugin_npapi/startup.cxx +++ b/direct/src/plugin_npapi/startup.cxx @@ -15,6 +15,7 @@ #include "startup.h" #include "p3d_plugin_config.h" #include "p3d_lock.h" +#include "ppBrowserObject.h" #ifdef _WIN32 #include @@ -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.