[f-spot] Don't crash if the import window was closed before sources are populated.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot] Don't crash if the import window was closed before sources are populated.
- Date: Fri, 22 Oct 2010 15:23:47 +0000 (UTC)
commit a9683a8d6fc9cb6a79d133b06e42898986479f4f
Author: Ruben Vermeersch <ruben savanne be>
Date: Fri Oct 22 17:20:11 2010 +0200
Don't crash if the import window was closed before sources are populated.
https://bugzilla.gnome.org/show_bug.cgi?id=632905
.../MainApp/FSpot.UI.Dialog/ImportDialog.cs | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/Clients/MainApp/FSpot.UI.Dialog/ImportDialog.cs b/src/Clients/MainApp/FSpot.UI.Dialog/ImportDialog.cs
index daa5fa3..0ec91e7 100644
--- a/src/Clients/MainApp/FSpot.UI.Dialog/ImportDialog.cs
+++ b/src/Clients/MainApp/FSpot.UI.Dialog/ImportDialog.cs
@@ -144,8 +144,14 @@ namespace FSpot.UI.Dialog
sources_combo.SetAttributes (render2, "text", 1, "sensitive", 3);
GLib.Idle.Add (() => {
- PopulateSourceCombo (null);
- QueueDraw ();
+ try {
+ PopulateSourceCombo (null);
+ QueueDraw ();
+ } catch (Exception e) {
+ // Swallow the exception if the import was cancelled / dialog was closed.
+ if (Controller != null)
+ throw e;
+ }
return false;
});
}
@@ -206,6 +212,7 @@ namespace FSpot.UI.Dialog
dialog.Title = Catalog.GetString ("Warning");
dialog.Response += (s, arg) => {
dialog.Destroy ();
+ Controller = null;
};
dialog.Run ();
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]