mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
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.
This commit is contained in:
@@ -314,9 +314,9 @@ void register_gdnative_types() {
|
||||
ClassDB::register_class<GDNative>();
|
||||
|
||||
resource_loader_gdnlib.instance();
|
||||
resource_saver_gdnlib.instance();
|
||||
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_gdnlib);
|
||||
|
||||
resource_saver_gdnlib.instance();
|
||||
ResourceSaver::add_resource_format_saver(resource_saver_gdnlib);
|
||||
|
||||
GDNativeCallRegistry::singleton = memnew(GDNativeCallRegistry);
|
||||
@@ -395,9 +395,9 @@ void unregister_gdnative_types() {
|
||||
#endif
|
||||
|
||||
ResourceLoader::remove_resource_format_loader(resource_loader_gdnlib);
|
||||
ResourceSaver::remove_resource_format_saver(resource_saver_gdnlib);
|
||||
|
||||
resource_loader_gdnlib.unref();
|
||||
|
||||
ResourceSaver::remove_resource_format_saver(resource_saver_gdnlib);
|
||||
resource_saver_gdnlib.unref();
|
||||
|
||||
// This is for printing out the sizes of the core types
|
||||
|
||||
@@ -197,6 +197,7 @@ public:
|
||||
};
|
||||
|
||||
class ResourceFormatLoaderVideoStreamGDNative : public ResourceFormatLoader {
|
||||
GDCLASS(ResourceFormatLoaderVideoStreamGDNative, 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;
|
||||
|
||||
Reference in New Issue
Block a user