Fix crash in PluginScript destructor

This commit is contained in:
ktksgit 2019-11-05 23:09:56 +01:00
parent 34d4c2ed81
commit eedf4b27a1
1 changed files with 10 additions and 4 deletions

View File

@ -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
}