seed r561 - trunk/libseed



Author: racarr
Date: Wed Dec 24 07:53:29 2008
New Revision: 561
URL: http://svn.gnome.org/viewvc/seed?rev=561&view=rev

Log:
Protect class_init and instance_init functions because references only
exist on the heap.

Modified:
   trunk/libseed/seed-gtype.c

Modified: trunk/libseed/seed-gtype.c
==============================================================================
--- trunk/libseed/seed-gtype.c	(original)
+++ trunk/libseed/seed-gtype.c	Wed Dec 24 07:53:29 2008
@@ -548,6 +548,7 @@
 		JSObjectIsFunction(ctx, (JSObjectRef) class_init))
 	{
 		init_closure = seed_make_class_init_closure((JSObjectRef) class_init);
+		JSValueProtect(ctx, class_init);
 	}
 	if (!JSValueIsNull(ctx, instance_init) &&
 		JSValueIsObject(ctx, instance_init) &&
@@ -555,6 +556,7 @@
 	{
 		instance_init_closure =
 			seed_make_instance_init_closure((JSObjectRef) instance_init);
+		JSValueProtect(ctx, instance_init);
 	}
 
 	parent_type = (GType) seed_value_to_int(ctx, parent_ref, exception);



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