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:
parent
e50ee63f0d
commit
445fe30046
3 changed files with 47 additions and 0 deletions
|
@ -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.
|
||||
|
|
19
glib/Idle.cs
19
glib/Idle.cs
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue