summaryrefslogtreecommitdiff
path: root/modules/vorbis
diff options
context:
space:
mode:
Diffstat (limited to 'modules/vorbis')
-rw-r--r--modules/vorbis/audio_stream_ogg_vorbis.h1
-rw-r--r--modules/vorbis/register_types.cpp7
2 files changed, 5 insertions, 3 deletions
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h
index 73c4b5f3f4..7683f38991 100644
--- a/modules/vorbis/audio_stream_ogg_vorbis.h
+++ b/modules/vorbis/audio_stream_ogg_vorbis.h
@@ -127,6 +127,7 @@ public:
};
class ResourceFormatLoaderAudioStreamOGGVorbis : public ResourceFormatLoader {
+ GDCLASS(ResourceFormatLoaderAudioStreamOGGVorbis, ResourceFormatLoader)
public:
virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
diff --git a/modules/vorbis/register_types.cpp b/modules/vorbis/register_types.cpp
index 0ea1fbe8b2..8219e9e7ba 100644
--- a/modules/vorbis/register_types.cpp
+++ b/modules/vorbis/register_types.cpp
@@ -32,16 +32,17 @@
#include "audio_stream_ogg_vorbis.h"
-static ResourceFormatLoaderAudioStreamOGGVorbis *vorbis_stream_loader = NULL;
+static Ref<ResourceFormatLoaderAudioStreamOGGVorbis> vorbis_stream_loader;
void register_vorbis_types() {
- vorbis_stream_loader = memnew(ResourceFormatLoaderAudioStreamOGGVorbis);
+ vorbis_stream_loader.instance();
ResourceLoader::add_resource_format_loader(vorbis_stream_loader);
ClassDB::register_class<AudioStreamOGGVorbis>();
}
void unregister_vorbis_types() {
- memdelete(vorbis_stream_loader);
+ ResourceLoader::remove_resource_format_loader(vorbis_stream_loader);
+ vorbis_stream_loader.unref();
}