diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-10 12:28:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-10 12:28:21 +0100 |
commit | 940a2c5ec3e13d57c6462b7070eb3101766c91db (patch) | |
tree | 0d70f125f200f5a680fad98d0f42e25baf9c6b1c /modules | |
parent | ebfd78ad7f1d40e0f5be36358a6464d43fd48d40 (diff) | |
parent | 7860b74b0f53393c8a1f0c5f2961b4b8e62bce43 (diff) |
Merge pull request #24878 from dragmz/patch-5
Remove vsgdnative loader on exit
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/videodecoder/register_types.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gdnative/videodecoder/register_types.cpp b/modules/gdnative/videodecoder/register_types.cpp index f2c4ab6d3b..ea78cb1970 100644 --- a/modules/gdnative/videodecoder/register_types.cpp +++ b/modules/gdnative/videodecoder/register_types.cpp @@ -33,18 +33,18 @@ #include "core/class_db.h" #include "video_stream_gdnative.h" -static ResourceFormatLoaderVideoStreamGDNative *resource_loader_vsgdnative = NULL; +static Ref<ResourceFormatLoaderVideoStreamGDNative> resource_loader_vsgdnative; void register_videodecoder_types() { - resource_loader_vsgdnative = memnew(ResourceFormatLoaderVideoStreamGDNative); + resource_loader_vsgdnative.instance(); ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true); + ClassDB::register_class<VideoStreamGDNative>(); } void unregister_videodecoder_types() { - if (resource_loader_vsgdnative) { - memdelete(resource_loader_vsgdnative); - } + ResourceLoader::remove_resource_format_loader(resource_loader_vsgdnative); + resource_loader_vsgdnative.unref(); } |