From 60f288cc584bf34c65698341427cf377b88c7138 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 25 Jun 2014 16:21:44 -0400 Subject: 2. connect signals (bzr r13341.5.2) --- src/inkscape.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 23c2b001a..4e8b06ef4 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -506,7 +506,7 @@ Application::Application() } this->menus = NULL; - //this->desktops = NULL; + this->desktops = NULL; this->_dialogs_toggle = TRUE; this->_mapalt = GDK_MOD1_MASK; this->_trackalt = FALSE; @@ -976,6 +976,10 @@ void Application::add_desktop (SPDesktop * desktop) { g_return_if_fail (desktop != NULL); + if (desktops == NULL) { + desktops = new std::list; + g_message("Creating new desktop list."); + } //g_return_if_fail (inkscape != NULL); g_assert (std::find(desktops->begin(), desktops->end(), desktop) == desktops->end()); @@ -1030,7 +1034,9 @@ Application::remove_desktop (SPDesktop * desktop) // if this was the last desktop, shut down the program if (desktops->empty()) { + g_message("Shutting down."); this->exit(); + delete desktops; } } @@ -1285,7 +1291,7 @@ Application::remove_document (SPDocument *document) SPDesktop * Application::active_desktop() { - if (desktops == NULL) { + if (!desktops || desktops->empty()) { return NULL; } -- cgit v1.2.3