mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
prevent crash at exit
This commit is contained in:
parent
6b0f19f13e
commit
843bc110c4
@ -14,6 +14,7 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "PPPandaObject.h"
|
||||
#include "load_plugin.h"
|
||||
|
||||
PPandaObject::PPandaObject( PPInterface* interfac, P3D_object* p3dObject ) :
|
||||
m_interface( interfac ), m_p3dObject( p3dObject ), m_refs( 0 ), m_ptinfo( NULL )
|
||||
@ -31,7 +32,10 @@ PPandaObject::~PPandaObject()
|
||||
{
|
||||
m_ptinfo->Release();
|
||||
}
|
||||
if ( m_p3dObject )
|
||||
|
||||
// Clean up the p3d_object, but only if we haven't already
|
||||
// unloaded the plugin.
|
||||
if ( m_p3dObject && is_plugin_loaded() )
|
||||
{
|
||||
P3D_OBJECT_DECREF( m_p3dObject );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user