[seed] closure: Don't call JSValueUnprotect() from a finalizer



commit 5a8d67438843c82eb9493114b7214b98c2c66431
Author: Sebastian Dröge <sebastian centricular com>
Date:   Thu Jan 8 10:16:47 2015 +0100

    closure: Don't call JSValueUnprotect() from a finalizer
    
    We would not get here at all anyway if the object still had a "protect count"
    higher than 0, as that would prevent the GC from cleaning up the object.
    
    Also the docs say:
    
    You must not call any function that may cause a garbage collection or an allocation
    of a garbage collected object from within a JSObjectFinalizeCallback. This includes
    all functions that have a JSContextRef parameter.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742574

 libseed/seed-closure.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
---
diff --git a/libseed/seed-closure.c b/libseed/seed-closure.c
index d3a44ba..4815cf4 100644
--- a/libseed/seed-closure.c
+++ b/libseed/seed-closure.c
@@ -37,8 +37,6 @@ seed_closure_finalize (JSObjectRef object)
   g_free (privates->cif);
   g_callable_info_free_closure (privates->info, privates->closure);
   g_base_info_unref ((GIBaseInfo *) privates->info);
-
-  JSValueUnprotect (eng->context, object);
 }
 
 static void


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