Merge pull request #24878 from dragmz/patch-5

Remove vsgdnative loader on exit
This commit is contained in:
Rémi Verschelde 2019-01-10 12:28:21 +01:00 committed by GitHub
commit 940a2c5ec3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,18 +33,18 @@
#include "core/class_db.h" #include "core/class_db.h"
#include "video_stream_gdnative.h" #include "video_stream_gdnative.h"
static ResourceFormatLoaderVideoStreamGDNative *resource_loader_vsgdnative = NULL; static Ref<ResourceFormatLoaderVideoStreamGDNative> resource_loader_vsgdnative;
void register_videodecoder_types() { void register_videodecoder_types() {
resource_loader_vsgdnative = memnew(ResourceFormatLoaderVideoStreamGDNative); resource_loader_vsgdnative.instance();
ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true); ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true);
ClassDB::register_class<VideoStreamGDNative>(); ClassDB::register_class<VideoStreamGDNative>();
} }
void unregister_videodecoder_types() { void unregister_videodecoder_types() {
if (resource_loader_vsgdnative) { ResourceLoader::remove_resource_format_loader(resource_loader_vsgdnative);
memdelete(resource_loader_vsgdnative); resource_loader_vsgdnative.unref();
}
} }