From 976426093108b27d5d72580fc991d658f7c478b8 Mon Sep 17 00:00:00 2001 From: Mikkel Kruse Johnsen Date: Tue, 8 Jan 2019 11:39:25 +0100 Subject: [PATCH] Free all internal signals, else the garbage collector is not able to free the object. --- Source/Libs/GLibSharp/Object.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/Libs/GLibSharp/Object.cs b/Source/Libs/GLibSharp/Object.cs index 3ba77e946..57bb28cc4 100644 --- a/Source/Libs/GLibSharp/Object.cs +++ b/Source/Libs/GLibSharp/Object.cs @@ -73,6 +73,16 @@ namespace GLib { tref.Dispose (); else tref.QueueUnref (); + + // Free all internal signals, else the garbage collector is not + // able to free the object. + if (signals != null) + { + foreach (var sig in signals.Keys) + signals[sig].Free (); + } + + signals = null; } public static bool WarnOnFinalize { get; set; }