[libglib-perl] 07/25: Add a short explanatory comment to the lazy-loading system

Intrigeri intrigeri at moszumanska.debian.org
Tue Dec 29 18:43:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch experimental
in repository libglib-perl.

commit 4060a61cb82be0b2a17f5468dca34611844f045c
Author: Torsten Schönfeld <kaffeetisch at gmx.de>
Date:   Wed Jul 22 15:31:21 2015 +0200

    Add a short explanatory comment to the lazy-loading system
---
 GObject.xs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/GObject.xs b/GObject.xs
index 94888af..fba49d2 100644
--- a/GObject.xs
+++ b/GObject.xs
@@ -419,7 +419,7 @@ gperl_register_object (GType gtype,
 	g_hash_table_replace (types_by_package, class_info->package, class_info);
 	g_hash_table_insert (types_by_type,
 	                     (gpointer) class_info->gtype, class_info);
-	/* warn ("registered class %s to package %s\n", class_info->class, class_info->package); */
+	/* warn ("registered type %s to package %s\n", g_type_name (class_info->gtype), class_info->package); */
 
 	/* defer the actual ISA setup to Glib::Object::_LazyLoader */
 	gperl_set_isa (package, "Glib::Object::_LazyLoader");
@@ -772,10 +772,14 @@ gperl_object_type_from_package (const char * package)
 
 		G_UNLOCK (types_by_package);
 
-		if (class_info)
+		if (class_info) {
+			/* class_info_finish_loading calls us, so even if
+			 * !class_info->initialized, we should not call it to
+			 * avoid recursion. */
 			return class_info->gtype;
-		else
+		} else {
 			return 0;
+		}
 	} else
 		croak ("internal problem: gperl_object_type_from_package "
 		       "called before any classes were registered");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libglib-perl.git



More information about the Pkg-perl-cvs-commits mailing list