[perl-Glib/gio-support: 5/12] [gio] Only register known GTypes with the Glib system



commit 11688c6c9734119afb68900146a853d37d6d67e6
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Wed Mar 3 00:03:23 2010 +0100

    [gio] Only register known GTypes with the Glib system

 GObjectIntrospection.xs |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/GObjectIntrospection.xs b/GObjectIntrospection.xs
index 5c56da6..586beb0 100644
--- a/GObjectIntrospection.xs
+++ b/GObjectIntrospection.xs
@@ -1169,15 +1169,19 @@ register_types (class, namespace, version, package)
 		    info_type != GI_INFO_TYPE_UNION &&
 		    info_type != GI_INFO_TYPE_ENUM &&
 		    info_type != GI_INFO_TYPE_FLAGS) {
-			g_base_info_unref ((GIBaseInfo *) info);
 			continue;
 		}
 
 		type = g_registered_type_info_get_g_type (
 			(GIRegisteredTypeInfo *) info);
-		if (!type)
+		g_base_info_unref ((GIBaseInfo *) info);
+		if (!type) {
 			croak ("Could not find GType for type %s::%s",
 			       namespace, name);
+		}
+		if (type == G_TYPE_NONE) {
+			continue;
+		}
 
 		full_package = g_strconcat (package, "::", name, NULL);
 		dwarn ("registering %s, %d => %s\n",
@@ -1215,7 +1219,6 @@ register_types (class, namespace, version, package)
 		}
 
 		g_free (full_package);
-		g_base_info_unref ((GIBaseInfo *) info);
 	}
 
 =for apidoc __hide__



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]