[pitivi] elements: Disconnect functions when cleaning up



commit b97385f1b87813c68b6b065f6776f1ac9dc91c1d
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Mon Jan 6 09:08:31 2014 +0100

    elements: Disconnect functions when cleaning up
    
    Without this, when selecting a clip then moving the mouse over one of
    the handlers then deleting the clip then moving the mouse away shows a
    stacktrace because the _leaveEventCb is called.

 pitivi/timeline/elements.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index e7c0d09..e27cacc 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -227,7 +227,6 @@ class TrimHandle(Clutter.Texture):
         self.set_reactive(True)
 
         self.add_action(self.dragAction)
-
         self.dragAction.connect("drag-begin", self._dragBeginCb)
         self.dragAction.connect("drag-end", self._dragEndCb)
         self.dragAction.connect("drag-progress", self._dragProgressCb)
@@ -240,6 +239,8 @@ class TrimHandle(Clutter.Texture):
         self.timelineElement.bElement.selected.connect("selected-changed", self._selectedChangedCb)
 
     def cleanup(self):
+        self.disconnect_by_func(self._enterEventCb)
+        self.disconnect_by_func(self._leaveEventCb)
         self.timelineElement.disconnect_by_func(self._elementEnterEventCb)
         self.timelineElement.disconnect_by_func(self._elementLeaveEventCb)
 


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