summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-01-10 12:45:57 +0100
committerRémi Verschelde <rverschelde@gmail.com>2019-01-10 12:45:57 +0100
commite5f1d19352dbaafab96538b91fad0ce11cf0d046 (patch)
treec3cf72310e91ced0bd739b61d1d3197df78c1313 /modules/gdscript
parent940a2c5ec3e13d57c6462b7070eb3101766c91db (diff)
Consistency in resource format saver/loader de-registration
Some used 'is_valid()' checks, others not. Validity is already checked in 'unref()', and 'remove_resource_format_*()' has an ERR_FAIL condition on 'is_null()' already (which shouldn't happen since we're only unregistering things that we previously registered. Also add missing GDCLASS statement in ResourceFormatLoaderVideoStreamGDNative, missed in #20552 which was last amended before #19501 was merged.
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/register_types.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp
index 9b55e99282..58b438092d 100644
--- a/modules/gdscript/register_types.cpp
+++ b/modules/gdscript/register_types.cpp
@@ -161,13 +161,9 @@ void unregister_gdscript_types() {
if (script_language_gd)
memdelete(script_language_gd);
- if (resource_loader_gd.is_valid()) {
- ResourceLoader::remove_resource_format_loader(resource_loader_gd);
- resource_loader_gd.unref();
- }
+ ResourceLoader::remove_resource_format_loader(resource_loader_gd);
+ resource_loader_gd.unref();
- if (resource_saver_gd.is_valid()) {
- ResourceSaver::remove_resource_format_saver(resource_saver_gd);
- resource_saver_gd.unref();
- }
+ ResourceSaver::remove_resource_format_saver(resource_saver_gd);
+ resource_saver_gd.unref();
}