[gjs/wip/ptomato/internals: 4/5] WIP - Plug vfunc trampoline leak



commit a74a78f4fd4cbf69c93488e376fcdb990370818a
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue Oct 4 21:41:30 2016 -0700

    WIP - Plug vfunc trampoline leak

 gi/object.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gi/object.cpp b/gi/object.cpp
index b789c18..70dab9e 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -2365,6 +2365,10 @@ gjs_hook_up_vfunc(JSContext *cx,
 
         *((ffi_closure **)method_ptr) = trampoline->closure;
 
+        /* implementor now owns the closure */
+        trampoline->closure = NULL;
+        gjs_callback_trampoline_unref(trampoline);
+
         g_base_info_unref(interface_info);
         g_base_info_unref(type_info);
         g_base_info_unref(field_info);


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