diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-10 14:25:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 14:25:09 +0100 |
commit | 899ad484e37f1f0544bd7c93c560f6a0ca980d5d (patch) | |
tree | b19f5e12a8b8319d0ce5c76d7d3de7afe9383ea7 /core | |
parent | 5bf8bdc97187aa17103e418b1e08a96d1681f211 (diff) | |
parent | e5f1d19352dbaafab96538b91fad0ce11cf0d046 (diff) |
Merge pull request #24883 from akien-mga/resourceformat-unregister
Consistency in resource format saver/loader de-registration
Diffstat (limited to 'core')
-rw-r--r-- | core/register_core_types.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 68e293ba13..666384b093 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -68,8 +68,8 @@ static Ref<ResourceFormatSaverBinary> resource_saver_binary; static Ref<ResourceFormatLoaderBinary> resource_loader_binary; static Ref<ResourceFormatImporter> resource_format_importer; - static Ref<ResourceFormatLoaderImage> resource_format_image; +static Ref<TranslationLoaderPO> resource_format_po; static _ResourceLoader *_resource_loader = NULL; static _ResourceSaver *_resource_saver = NULL; @@ -77,7 +77,6 @@ static _OS *_os = NULL; static _Engine *_engine = NULL; static _ClassDB *_classdb = NULL; static _Marshalls *_marshalls = NULL; -static Ref<TranslationLoaderPO> resource_format_po; static _JSON *_json = NULL; static IP *ip = NULL; @@ -251,25 +250,17 @@ void unregister_core_types() { memdelete(_geometry); - if (resource_format_image.is_valid()) { - ResourceLoader::remove_resource_format_loader(resource_format_image); - resource_format_image.unref(); - } - - if (resource_saver_binary.is_valid()) { - ResourceSaver::remove_resource_format_saver(resource_saver_binary); - resource_saver_binary.unref(); - } - - if (resource_loader_binary.is_valid()) { - ResourceLoader::remove_resource_format_loader(resource_loader_binary); - resource_loader_binary.unref(); - } - - if (resource_format_importer.is_valid()) { - ResourceLoader::remove_resource_format_loader(resource_format_importer); - resource_format_importer.unref(); - } + ResourceLoader::remove_resource_format_loader(resource_format_image); + resource_format_image.unref(); + + ResourceSaver::remove_resource_format_saver(resource_saver_binary); + resource_saver_binary.unref(); + + ResourceLoader::remove_resource_format_loader(resource_loader_binary); + resource_loader_binary.unref(); + + ResourceLoader::remove_resource_format_loader(resource_format_importer); + resource_format_importer.unref(); ResourceLoader::remove_resource_format_loader(resource_format_po); resource_format_po.unref(); |