summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c4a786)
raw | patch | inline | side by side (parent: 3c4a786)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sat, 6 Jun 2009 21:41:18 +0000 (21:41 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sat, 6 Jun 2009 21:41:18 +0000 (21:41 +0000) |
src/interface.cpp | patch | blob | history |
diff --git a/src/interface.cpp b/src/interface.cpp
index d628d964d3bc10bfc5e2e62546101d91de8fe7e4..a751608c582bc80c6f9b1741860e87414e107a92 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
void
sp_ui_close_view(GtkWidget */*widget*/)
{
- if (SP_ACTIVE_DESKTOP == NULL) {
+ SPDesktop *dt = SP_ACTIVE_DESKTOP;
+
+ if (dt == NULL) {
return;
}
- if ((SP_ACTIVE_DESKTOP)->shutdown()) {
- return;
+
+ if (dt->shutdown()) {
+ return; // Shutdown operation has been canceled, so do nothing
}
- SP_ACTIVE_DESKTOP->destroyWidget();
+
+ // Shutdown can proceed; use the stored reference to the desktop here instead of the current SP_ACTIVE_DESKTOP,
+ // because the user might have changed the focus in the meantime (see bug #381357 on Launchpad)
+ dt->destroyWidget();
}
/* Iterate through all the windows, destroying each in the order they
become active */
while (SP_ACTIVE_DESKTOP) {
- if ((SP_ACTIVE_DESKTOP)->shutdown()) {
- /* The user cancelled the operation, so end doing the close */
+ SPDesktop *dt = SP_ACTIVE_DESKTOP;
+ if (dt->shutdown()) {
+ /* The user canceled the operation, so end doing the close */
return FALSE;
}
- SP_ACTIVE_DESKTOP->destroyWidget();
+ // Shutdown can proceed; use the stored reference to the desktop here instead of the current SP_ACTIVE_DESKTOP,
+ // because the user might have changed the focus in the meantime (see bug #381357 on Launchpad)
+ dt->destroyWidget();
}
return TRUE;