2009-09-22 Brad Taylor <brad@getcoded.net>

* glib/Idle.cs: 
	* glib/Timeout.cs: Make sure to remove the unmanaged reference to the
	delegate when we're disposed or finalized.  In particular, this fixes a
	problem where GLib.Object's PerformQueuedUnrefs was being called after
	both the object and the handler had been GC'ed, resulting in a
	segfault.


svn path=/trunk/gtk-sharp/; revision=142362
This commit is contained in:
Brad Taylor 2009-09-22 02:19:50 +00:00
parent e50ee63f0d
commit 445fe30046
3 changed files with 47 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2009-09-22 Brad Taylor <brad@getcoded.net>
* glib/Idle.cs:
* glib/Timeout.cs: Make sure to remove the unmanaged reference to the
delegate when we're disposed or finalized. In particular, this fixes a
problem where GLib.Object's PerformQueuedUnrefs was being called after
both the object and the handler had been GC'ed, resulting in a
segfault.
2009-09-16 Mike Kestner <mkestner@novell.com>
* gtk/Gtk.metadata: hide StatusIcon.GetGeometry for custom impl.

View file

@ -45,6 +45,25 @@ namespace GLib {
proxy_handler = new IdleHandlerInternal (Handler);
}
~IdleProxy ()
{
Dispose (false);
}
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (disposing)
Remove ();
Source.Remove (ID);
}
public bool Handler ()
{
try {

View file

@ -42,6 +42,25 @@ namespace GLib {
proxy_handler = new TimeoutHandlerInternal (Handler);
}
~TimeoutProxy ()
{
Dispose (false);
}
public void Dispose ()
{
Dispose (true);
GC.SuppressFinalize (this);
}
protected virtual void Dispose (bool disposing)
{
if (disposing)
Remove ();
Source.Remove (ID);
}
public bool Handler ()
{
try {