[pitivi/gtktimeline] timeline: Properly clear layer.ui when removing a layer
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/gtktimeline] timeline: Properly clear layer.ui when removing a layer
- Date: Sat, 16 May 2015 09:29:44 +0000 (UTC)
commit 917acec474d36c22723a730cf02eee34d8e7bb1b
Author: Thibault Saunier <tsaunier gnome org>
Date: Sat May 16 11:04:54 2015 +0200
timeline: Properly clear layer.ui when removing a layer
Fixes http://phabricator.freedesktop.org/T62
pitivi/timeline/layer.py | 7 +++++++
pitivi/timeline/timeline.py | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 975331c..2f64b59 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -525,6 +525,12 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.before_sep = None
self.after_sep = None
+ def release(self):
+ for clip in self.bLayer.get_clips():
+ self._removeClip(clip)
+ self.bLayer.disconnect_by_func(self._clipAddedCb)
+ self.bLayer.disconnect_by_func(self._clipRemovedCb)
+
def checkMediaTypes(self, bClip=None):
if self.timeline.editing_context:
self.info("Not updating media types as"
@@ -604,6 +610,7 @@ class Layer(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
return
self._layout.remove(bClip.ui)
+ bClip.ui.layer = None
if self.timeline.draggingElement is None:
bClip.ui = None
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 0a40a2a..7cdd46b 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -777,6 +777,7 @@ class Timeline(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
self.__layers_controls_vbox.remove(bLayer.control_ui)
self._layers.remove(bLayer.ui)
+ bLayer.ui.release()
bLayer.ui = None
bLayer.control_ui = None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]