[banshee] [NotificationArea] Disconnect seek-slider on Dispose



commit b060c630cefd3f6f10fa31f869a8d3fd1def6c63
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Thu Mar 18 14:23:06 2010 -0700

    [NotificationArea] Disconnect seek-slider on Dispose

 .../Banshee.NotificationArea/TrackInfoPopup.cs     |    1 +
 .../X11NotificationAreaBox.cs                      |   27 +++++++++++++------
 2 files changed, 19 insertions(+), 9 deletions(-)
---
diff --git a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs
index bee0ec9..8c5e81e 100644
--- a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs
+++ b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs
@@ -69,6 +69,7 @@ namespace Banshee.NotificationArea
 
         public override void Dispose ()
         {
+            seek_slider.Disconnect ();
             header.Dispose ();
             base.Dispose ();
         }
diff --git a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
index c165e6f..a1f84a5 100644
--- a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
+++ b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
@@ -214,6 +214,9 @@ namespace Banshee.NotificationArea
             }
 
             popup.Hide ();
+            popup.EnterNotifyEvent -= OnPopupEnterNotify;
+            popup.LeaveNotifyEvent -= OnPopupLeaveNotify;
+            popup.Destroy ();
             popup.Dispose ();
             popup = null;
         }
@@ -225,21 +228,27 @@ namespace Banshee.NotificationArea
             }
 
             popup = new TrackInfoPopup ();
-            popup.EnterNotifyEvent += delegate {
-                hide_delay_started = false;
-            };
-            popup.LeaveNotifyEvent += delegate(object o, LeaveNotifyEventArgs args) {
-                Gdk.Rectangle rect;
-                if (!popup.Intersect (new Gdk.Rectangle ((int)args.Event.X, (int)args.Event.Y, 1, 1), out rect)) {
-                    OnLeaveNotifyEvent (o, args);
-                }
-            };
+            popup.EnterNotifyEvent += OnPopupEnterNotify;
+            popup.LeaveNotifyEvent += OnPopupLeaveNotify;
 
             PositionPopup ();
 
             popup.Show ();
         }
 
+        private void OnPopupEnterNotify (object o, EnterNotifyEventArgs args)
+        {
+            hide_delay_started = false;
+        }
+
+        private void OnPopupLeaveNotify (object o, LeaveNotifyEventArgs args)
+        {
+            Gdk.Rectangle rect;
+            if (!popup.Intersect (new Gdk.Rectangle ((int)args.Event.X, (int)args.Event.Y, 1, 1), out rect)) {
+                OnLeaveNotifyEvent (o, args);
+            }
+        }
+
         private void PositionPopup ()
         {
             int x, y;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]