2008-05-21 Mike Kestner <mkestner@novell.com>
* gtk/Object.custom (OnDestroyed): ensure Dispose runs even if no Destroyed handlers are connected. svn path=/trunk/gtk-sharp/; revision=103708
This commit is contained in:
parent
ca3b6b9067
commit
a1473c0b58
2 changed files with 10 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-05-21 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* gtk/Object.custom (OnDestroyed): ensure Dispose runs even if
|
||||||
|
no Destroyed handlers are connected.
|
||||||
|
|
||||||
2008-05-21 Mike Kestner <mkestner@novell.com>
|
2008-05-21 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* gtk/Application.cs (CurrentEvent): use Event.GetEvent to retrieve
|
* gtk/Application.cs (CurrentEvent): use Event.GetEvent to retrieve
|
||||||
|
|
|
@ -41,12 +41,11 @@
|
||||||
[GLib.DefaultSignalHandler(Type=typeof(Gtk.Object), ConnectionMethod="OverrideDestroyed")]
|
[GLib.DefaultSignalHandler(Type=typeof(Gtk.Object), ConnectionMethod="OverrideDestroyed")]
|
||||||
protected virtual void OnDestroyed ()
|
protected virtual void OnDestroyed ()
|
||||||
{
|
{
|
||||||
if (DestroyHandlers [Handle] == null)
|
if (DestroyHandlers.Contains (Handle)) {
|
||||||
return;
|
EventHandler handler = (EventHandler) DestroyHandlers [Handle];
|
||||||
|
handler (this, EventArgs.Empty);
|
||||||
EventHandler handler = (EventHandler) DestroyHandlers [Handle];
|
DestroyHandlers.Remove (Handle);
|
||||||
handler (this, EventArgs.Empty);
|
}
|
||||||
DestroyHandlers [Handle] = null;
|
|
||||||
Dispose ();
|
Dispose ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue