1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Remove bogus nulls from generated default values

Also, fix crash in PluginScript destructor.
This commit is contained in:
Bojidar Marinov
2019-06-29 15:51:33 +03:00
parent ae70eca5af
commit 55234d62b0
4 changed files with 30 additions and 12 deletions

View File

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