diff --git a/direct/src/plugin_activex/PPBrowserObject.cpp b/direct/src/plugin_activex/PPBrowserObject.cpp index f6efe04849..0b26c4b290 100644 --- a/direct/src/plugin_activex/PPBrowserObject.cpp +++ b/direct/src/plugin_activex/PPBrowserObject.cpp @@ -183,6 +183,11 @@ int PPBrowserObject::get_repr( char* buffer, int buffer_length ) const return (int)result.GetLength(); } +void PPBrowserObject::clear_class_definition() +{ + _browser_object_class = NULL; +} + P3D_class_definition* PPBrowserObject::get_class_definition() { if ( _browser_object_class == NULL ) diff --git a/direct/src/plugin_activex/PPBrowserObject.h b/direct/src/plugin_activex/PPBrowserObject.h index e51190db56..75e3fa8f02 100644 --- a/direct/src/plugin_activex/PPBrowserObject.h +++ b/direct/src/plugin_activex/PPBrowserObject.h @@ -34,6 +34,8 @@ public: P3D_object* params[], int num_params ) const; P3D_object* eval( const std::string &expression ) const; + static void clear_class_definition(); + protected: PPBrowserObject( ); static P3D_class_definition* get_class_definition( ); diff --git a/direct/src/plugin_activex/PPInstance.cpp b/direct/src/plugin_activex/PPInstance.cpp index ac13dde335..de972eeac6 100644 --- a/direct/src/plugin_activex/PPInstance.cpp +++ b/direct/src/plugin_activex/PPInstance.cpp @@ -317,6 +317,10 @@ int PPInstance::UnloadPlugin() { s_hP3DPluginDll = NULL; } + + // This pointer is no longer valid and must be reset for next + // time. + PPBrowserObject::clear_class_definition(); } return error; }