[pitivi] project_: Disconnect callback method when closing project
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] project_: Disconnect callback method when closing project
- Date: Tue, 9 Feb 2016 13:14:09 +0000 (UTC)
commit ab42419aafd61730f96d79cb9fcd935a21a4334c
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Feb 9 12:34:00 2016 +0100
project_: Disconnect callback method when closing project
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D746
pitivi/project.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/project.py b/pitivi/project.py
index 232f58f..f11adaf 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -229,7 +229,7 @@ class ProjectManager(GObject.Object, Loggable):
return False
- def _pipelineDied(self, unused_pipeline):
+ def _projectPipelineDiedCb(self, unused_pipeline):
"""
Show an error dialog telling the user that everything went kaboom.
"""
@@ -327,7 +327,7 @@ class ProjectManager(GObject.Object, Loggable):
self.emit("new-project-created", self.current_project)
self.current_project.connect(
"project-changed", self._projectChangedCb)
- self.current_project.pipeline.connect("died", self._pipelineDied)
+ self.current_project.pipeline.connect("died", self._projectPipelineDiedCb)
if is_validate_scenario:
self.current_project.setupValidateScenario()
@@ -568,6 +568,10 @@ class ProjectManager(GObject.Object, Loggable):
except Exception:
self.debug(
"Tried disconnecting signals, but they were not connected")
+ try:
+ self.current_project.pipeline.disconnect_by_function(self._projectPipelineDiedCb)
+ except Exception:
+ self.fixme("Handle better the errors and not get to this point")
self._cleanBackup(self.current_project.uri)
self.exitcode = self.current_project.release()
self.current_project = None
@@ -604,7 +608,7 @@ class ProjectManager(GObject.Object, Loggable):
self.emit("new-project-created", project)
project.connect("project-changed", self._projectChangedCb)
- project.pipeline.connect("died", self._pipelineDied)
+ project.pipeline.connect("died", self._projectPipelineDiedCb)
project.setModificationState(False)
self.emit("new-project-loaded", self.current_project, emission)
self.time_loaded = time.time()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]