r18574 by jghali - #11803: Closing Scribus while editing inline items cause crash

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 24 22:47:47 UTC 2013


Author: jghali
Date: Thu Oct 24 22:47:47 2013
New Revision: 18574

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18574
Log:
#11803: Closing Scribus while editing inline items cause crash

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/inlinepalette.cpp
    trunk/Scribus/scribus/ui/symbolpalette.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18574&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Oct 24 22:47:47 2013
@@ -1826,7 +1826,7 @@
 				newActWin(windows.at(i));
 				tw = ActWin;
 				slotSelect();
-				ActWin->close();
+				tws->close();
 				if (tw == ActWin)
 				{
 					ce->ignore();
@@ -5197,14 +5197,21 @@
 
 void ScribusMainWindow::slotFileQuit()
 {
-	propertiesPalette->unsetDoc();
+	// #11803 : Not necessary, done via closeEvent() if required.
+	// Unsetting doc from palette is premature if doc is in a 
+	// special mode, eg. symbol edition or inline fram edition
+	// Disconnection of toolbar signals is also done by closeEvent()
+	// whean appropriate, ie only if all docs have been closed. 
+	/*propertiesPalette->unsetDoc();
 	symbolPalette->unsetDoc();
 	inlinePalette->unsetDoc();
-	ScCore->pluginManager->savePreferences();
 	fileToolBar->connectPrefsSlot(false);
 	editToolBar->connectPrefsSlot(false);
 	modeToolBar->connectPrefsSlot(false);
-	pdfToolBar->connectPrefsSlot(false);
+	pdfToolBar->connectPrefsSlot(false);*/
+
+	ScCore->pluginManager->savePreferences();
+
 	close();
 }
 

Modified: trunk/Scribus/scribus/ui/inlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18574&path=/trunk/Scribus/scribus/ui/inlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/inlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/inlinepalette.cpp Thu Oct 24 22:47:47 2013
@@ -251,6 +251,8 @@
 {
 	InlineViewWidget->clear();
 	InlineViewWidget->setWordWrap(true);
+	if (!m_doc)
+		return;
 	for (QHash<int, PageItem*>::iterator it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
 	{
 		PageItem *currItem = it.value();

Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18574&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Thu Oct 24 22:47:47 2013
@@ -232,6 +232,9 @@
 {
 	SymbolViewWidget->clear();
 	SymbolViewWidget->setWordWrap(true);
+	if (!m_doc)
+		return;
+
 	QStringList patK = m_doc->docPatterns.keys();
 	qSort(patK);
 	for (int a = 0; a < patK.count(); a++)




More information about the scribus-commit mailing list