Fix crash in PluginScript destructor
This commit is contained in:
parent
34d4c2ed81
commit
eedf4b27a1
|
@ -473,6 +473,8 @@ MultiplayerAPI::RPCMode PluginScript::get_rset_mode(const StringName &p_variable
|
|||
|
||||
PluginScript::PluginScript() :
|
||||
_data(NULL),
|
||||
_desc(NULL),
|
||||
_language(NULL),
|
||||
_tool(false),
|
||||
_valid(false),
|
||||
_script_list(this) {
|
||||
|
@ -490,11 +492,15 @@ void PluginScript::init(PluginScriptLanguage *language) {
|
|||
}
|
||||
|
||||
PluginScript::~PluginScript() {
|
||||
if (_desc && _data) {
|
||||
_desc->finish(_data);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (_language) {
|
||||
_language->lock();
|
||||
_language->_script_list.remove(&_script_list);
|
||||
_language->unlock();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue