r13908 by jghali - #8381: Scribus crashes when window is closed while still rendering preview mode
scribus-commit
scribus-commit at lists.scribus.net
Wed Aug 26 05:55:27 CEST 2009
Revision: 13908
Author: jghali
Date: 2009-08-24T18:45:49.426608Z
Commit message: #8381: Scribus crashes when window is closed while still rendering preview mode
Changeset:
M /branches/Version135/Scribus/scribus/scribusdoc.cpp
M /branches/Version135/Scribus/scribus/scribusview.cpp
Diffs:
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp (revision 13907)
+++ scribus/scribusview.cpp (revision 13908)
@@ -457,10 +457,14 @@
previewToolbarButton->setChecked(m_canvas->m_viewMode.viewAsPreview);
#endif
visualMenu->setEnabled(m_canvas->m_viewMode.viewAsPreview);
+ ScGuardedPtr<ScribusDoc> docPtr = Doc->guardedPtr();
Doc->recalculateColors();
Doc->recalcPicturesRes();
// repaintContents(QRect());
- DrawNew();
+ if (docPtr) // document may have been destroyed in-between
+ {
+ DrawNew();
+ }
}
void ScribusView::changed(QRectF re)
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp (revision 13907)
+++ scribus/scribusdoc.cpp (revision 13908)
@@ -6623,6 +6623,7 @@
{
int cc = 0;
int ca = 0;
+ ScGuardedPtr<ScribusDoc> docPtr = guardedPtr();
m_ScMW->mainWindowProgressBar->reset();
for (int a = 0; a < DocItems.count(); ++a)
{
@@ -6670,6 +6671,7 @@
ca++;
m_ScMW->mainWindowProgressBar->setValue(ca);
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+ if (!docPtr) return;
}
}
for (int a = 0; a < MasterItems.count(); ++a)
@@ -6688,6 +6690,7 @@
ca++;
m_ScMW->mainWindowProgressBar->setValue(ca);
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+ if (!docPtr) return;
}
}
for (int a = 0; a < FrameItems.count(); ++a)
@@ -6706,6 +6709,7 @@
ca++;
m_ScMW->mainWindowProgressBar->setValue(ca);
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+ if (!docPtr) return;
}
}
for (int c = 0; c < patterns.count(); ++c)
@@ -6727,6 +6731,7 @@
ca++;
m_ScMW->mainWindowProgressBar->setValue(ca);
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
+ if (!docPtr) return;
}
}
PageItem *ite = pa.items.at(0);
More information about the scribus-commit
mailing list