Merge pull request #33373 from ktksgit/fix_crash_in_pluginscript
Fix crash in PluginScript destructor
This commit is contained in:
commit
5cdd17194e
|
@ -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() {
|
||||
_desc->finish(_data);
|
||||
if (_desc && _data) {
|
||||
_desc->finish(_data);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
_language->lock();
|
||||
_language->_script_list.remove(&_script_list);
|
||||
_language->unlock();
|
||||
if (_language) {
|
||||
_language->lock();
|
||||
_language->_script_list.remove(&_script_list);
|
||||
_language->unlock();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue