perl-Glib r1049 - branches/stable-1-20
- From: tsch svn gnome org
- To: svn-commits-list gnome org
- Subject: perl-Glib r1049 - branches/stable-1-20
- Date: Sat, 15 Nov 2008 14:00:25 +0000 (UTC)
Author: tsch
Date: Sat Nov 15 14:00:25 2008
New Revision: 1049
URL: http://svn.gnome.org/viewvc/perl-Glib?rev=1049&view=rev
Log:
Merge r1048 from trunk.
Modified:
branches/stable-1-20/ (props changed)
branches/stable-1-20/ChangeLog
branches/stable-1-20/GBoxed.xs
branches/stable-1-20/GObject.xs
branches/stable-1-20/GType.xs
Modified: branches/stable-1-20/GBoxed.xs
==============================================================================
--- branches/stable-1-20/GBoxed.xs (original)
+++ branches/stable-1-20/GBoxed.xs Sat Nov 15 14:00:25 2008
@@ -186,8 +186,13 @@
NULL);
}
boxed_info = boxed_info_new (gtype, package, wrapper_class);
+ /* We need to insert into info_by_package first because there might
+ * otherwise be trouble if we overwrite an entry: inserting into
+ * info_by_gtype frees the boxed_info of the overwritten entry, so that
+ * boxed_info->package is no longer valid at this point.
+ */
+ g_hash_table_insert (info_by_package, boxed_info->package, boxed_info);
g_hash_table_insert (info_by_gtype, (gpointer) gtype, boxed_info);
- g_hash_table_insert (info_by_package, (gchar*)package, boxed_info);
/* GBoxed types are plain structures, so it would be really
* surprising to find a boxed type that actually inherits another
Modified: branches/stable-1-20/GObject.xs
==============================================================================
--- branches/stable-1-20/GObject.xs (original)
+++ branches/stable-1-20/GObject.xs Sat Nov 15 14:00:25 2008
@@ -329,9 +329,14 @@
NULL);
}
class_info = class_info_new (gtype, package);
+ /* We need to insert into types_by_package first because there might
+ * otherwise be trouble if we overwrite an entry: inserting into
+ * types_by_gtype frees the class_info of the overwritten entry, so
+ * that class_info->package is no longer valid at this point.
+ */
+ g_hash_table_insert (types_by_package, class_info->package, class_info);
g_hash_table_insert (types_by_type,
(gpointer) class_info->gtype, class_info);
- g_hash_table_insert (types_by_package, class_info->package, class_info);
/* warn ("registered class %s to package %s\n", class_info->class, class_info->package); */
/* defer the actual ISA setup to Glib::Object::_LazyLoader */
Modified: branches/stable-1-20/GType.xs
==============================================================================
--- branches/stable-1-20/GType.xs (original)
+++ branches/stable-1-20/GType.xs Sat Nov 15 14:00:25 2008
@@ -95,8 +95,12 @@
(GDestroyNotify)g_free);
}
p = g_strdup (package);
- g_hash_table_insert (packages_by_type, (gpointer) gtype, p);
+ /* We need to insert into types_by_package first because there might
+ * otherwise be trouble if we overwrite an entry: inserting into
+ * packages_by_type frees the copied package name.
+ */
g_hash_table_insert (types_by_package, p, (gpointer) gtype);
+ g_hash_table_insert (packages_by_type, (gpointer) gtype, p);
G_UNLOCK (types_by_package);
G_UNLOCK (packages_by_type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]