[seed] Protect struct and union prototypes after putting them in the hash table...fixes a crash



commit bd4626f4ac8fa0138f4af8ec8331638f83b02988
Author: Robert Carr <racarr mireia (none)>
Date:   Tue Apr 14 00:51:06 2009 -0400

    Protect struct and union prototypes after putting them in the hash table...fixes a crash
---
 libseed/seed-structs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libseed/seed-structs.c b/libseed/seed-structs.c
index f193ff2..ec12019 100644
--- a/libseed/seed-structs.c
+++ b/libseed/seed-structs.c
@@ -511,6 +511,7 @@ seed_union_prototype (JSContextRef ctx, GIBaseInfo * info)
   if (!proto)
     {
       proto = JSObjectMake (ctx, 0, 0);
+      JSValueProtect (eng->context, proto);
 
       n_methods = g_union_info_get_n_methods ((GIUnionInfo *) info);
       for (i = 0; i < n_methods; i++)
@@ -596,6 +597,7 @@ seed_struct_prototype (JSContextRef ctx, GIBaseInfo * info)
   if (!proto)
     {
       proto = JSObjectMake (ctx, 0, 0);
+      JSValueProtect (eng->context, proto);
 
       n_methods = g_struct_info_get_n_methods ((GIStructInfo *) info);
       for (i = 0; i < n_methods; i++)



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