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>
|
||||
|
||||
* gtk/Application.cs (CurrentEvent): use Event.GetEvent to retrieve
|
||||
|
|
|
@ -41,12 +41,11 @@
|
|||
[GLib.DefaultSignalHandler(Type=typeof(Gtk.Object), ConnectionMethod="OverrideDestroyed")]
|
||||
protected virtual void OnDestroyed ()
|
||||
{
|
||||
if (DestroyHandlers [Handle] == null)
|
||||
return;
|
||||
|
||||
EventHandler handler = (EventHandler) DestroyHandlers [Handle];
|
||||
handler (this, EventArgs.Empty);
|
||||
DestroyHandlers [Handle] = null;
|
||||
if (DestroyHandlers.Contains (Handle)) {
|
||||
EventHandler handler = (EventHandler) DestroyHandlers [Handle];
|
||||
handler (this, EventArgs.Empty);
|
||||
DestroyHandlers.Remove (Handle);
|
||||
}
|
||||
Dispose ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue