diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-29 18:38:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-29 18:38:12 +0200 |
commit | 176188b1c65c6be1d1a3b99916d26cc8b3209bef (patch) | |
tree | b0b8fbb4987803c8b3297bd1b569916b27dcbe4d /modules/gdnative/pluginscript/pluginscript_script.cpp | |
parent | b0809046bedf882008788169430ebb3e83acbbea (diff) | |
parent | 55234d62b079fd6a18b9f0dafaf4af296becfe20 (diff) | |
download | redot-engine-176188b1c65c6be1d1a3b99916d26cc8b3209bef.tar.gz |
Merge pull request #30187 from bojidar-bg/30184-null-values
Remove bogus nulls from generated default values
Diffstat (limited to 'modules/gdnative/pluginscript/pluginscript_script.cpp')
-rw-r--r-- | modules/gdnative/pluginscript/pluginscript_script.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 310fa7000e..3ecb29404a 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -229,6 +229,8 @@ void PluginScript::set_source_code(const String &p_code) { } Error PluginScript::reload(bool p_keep_state) { + ERR_FAIL_COND_V(!_language, ERR_UNCONFIGURED); + _language->lock(); ERR_FAIL_COND_V(!p_keep_state && _instances.size(), ERR_ALREADY_IN_USE); _language->unlock(); @@ -473,6 +475,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 +494,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 } |