summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-08 15:25:05 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-09 11:28:26 (GMT)
commit2caa16ff98348b043ecc3598e5b9af4a2e2ae3bc (patch)
tree7de6d53667a5d680af08cb340d3d127dc7b62c1b /src/gui/dialogs
parentf98f5c5432f13238fc640820cc222b671c1ee8df (diff)
downloadQt-2caa16ff98348b043ecc3598e5b9af4a2e2ae3bc.zip
Qt-2caa16ff98348b043ecc3598e5b9af4a2e2ae3bc.tar.gz
Qt-2caa16ff98348b043ecc3598e5b9af4a2e2ae3bc.tar.bz2
Fixed crash when printing to files under Cocoa
When we select save as PDF in the print dialog, we get a new PMPrintSession in the printInfo object, while our stored one is deleted, so we update the pointer to be on the safe side Reviewed-by: msorvig
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qprintdialog_mac.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/dialogs/qprintdialog_mac.mm b/src/gui/dialogs/qprintdialog_mac.mm
index a7587b1..667fc40 100644
--- a/src/gui/dialogs/qprintdialog_mac.mm
+++ b/src/gui/dialogs/qprintdialog_mac.mm
@@ -166,6 +166,12 @@ QT_USE_NAMESPACE
}
// Keep us in sync with file output
PMDestinationType dest;
+
+ // If the user selected print to file, the session has been
+ // changed behind our back and our d->ep->session object is a
+ // dangling pointer. Update it based on the "current" session
+ d->ep->session = static_cast<PMPrintSession>([d->ep->printInfo PMPrintSession]);
+
PMSessionGetDestinationType(d->ep->session, d->ep->settings, &dest);
if (dest == kPMDestinationFile) {
QCFType<CFURLRef> file;