From 6fbd419c1d3204742dc66d033daaf0c348235d90 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 13 Oct 2011 05:23:39 -0500 Subject: [PATCH] Remove source delegates by id. * glib/Idle.cs: use g_source_remove and id in Remove(Delegate) * glib/Timeout.cs: use g_source_remove and id in Remove(Delegate) [Fixes #632765] --- glib/Idle.cs | 8 ++++---- glib/Timeout.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/glib/Idle.cs b/glib/Idle.cs index 2339f84a6..d4e07653e 100755 --- a/glib/Idle.cs +++ b/glib/Idle.cs @@ -27,7 +27,7 @@ namespace GLib { using System; - using System.Collections; + using System.Collections.Generic; using System.Runtime.InteropServices; public delegate bool IdleHandler (); @@ -116,7 +116,7 @@ namespace GLib { } [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] - static extern bool g_source_remove_by_funcs_user_data (Delegate d, IntPtr data); + static extern bool g_source_remove (uint id); public static void Remove (uint id) { @@ -126,7 +126,7 @@ namespace GLib { public static bool Remove (IdleHandler hndlr) { bool result = false; - ArrayList keys = new ArrayList (); + List keys = new List (); lock (Source.source_handlers) { foreach (uint code in Source.source_handlers.Keys) { @@ -134,7 +134,7 @@ namespace GLib { if (p != null && p.real_handler == hndlr) { keys.Add (code); - result = g_source_remove_by_funcs_user_data (p.proxy_handler, IntPtr.Zero); + result = g_source_remove (code); } } diff --git a/glib/Timeout.cs b/glib/Timeout.cs index 9aa348af5..ccb261e77 100755 --- a/glib/Timeout.cs +++ b/glib/Timeout.cs @@ -25,7 +25,7 @@ namespace GLib { using System; - using System.Collections; + using System.Collections.Generic; using System.Runtime.InteropServices; public delegate bool TimeoutHandler (); @@ -131,12 +131,12 @@ namespace GLib { } [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] - static extern bool g_source_remove_by_funcs_user_data (Delegate d, IntPtr data); + static extern bool g_source_remove (uint id); public static bool Remove (TimeoutHandler hndlr) { bool result = false; - ArrayList keys = new ArrayList (); + List keys = new List (); lock (Source.source_handlers) { foreach (uint code in Source.source_handlers.Keys) { @@ -144,7 +144,7 @@ namespace GLib { if (p != null && p.real_handler == hndlr) { keys.Add (code); - result = g_source_remove_by_funcs_user_data (p.proxy_handler, IntPtr.Zero); + result = g_source_remove (code); } }