Changing timeout_add and idle_add to _full.

This commit is contained in:
Midhun Mohan 2020-02-18 11:36:54 +00:00 committed by Harry
parent 89cfd16c10
commit 6af04a1058
2 changed files with 6 additions and 2 deletions

View file

@ -78,7 +78,9 @@ namespace GLib {
IdleProxy p = new IdleProxy (hndlr);
lock (p)
{
p.ID = g_idle_add ((IdleHandlerInternal) p.proxy_handler, IntPtr.Zero);
var gch = GCHandle.Alloc(p);
var userData = GCHandle.ToIntPtr(gch);
p.ID = g_idle_add_full (0, (IdleHandlerInternal) p.proxy_handler, userData, DestroyHelper.NotifyHandler);
Source.AddSourceHandler (p.ID, p);
}

View file

@ -73,7 +73,9 @@ namespace GLib {
TimeoutProxy p = new TimeoutProxy (hndlr);
lock (p)
{
p.ID = g_timeout_add (interval, (TimeoutHandlerInternal) p.proxy_handler, IntPtr.Zero);
var gch = GCHandle.Alloc(p);
var userData = GCHandle.ToIntPtr(gch);
p.ID = g_timeout_add_full (0, interval, (TimeoutHandlerInternal) p.proxy_handler, userData, DestroyHelper.NotifyHandler);
Source.AddSourceHandler (p.ID, p);
}