diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-08 17:25:05 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-09 13:28:26 +0200 |
commit | 2caa16ff98348b043ecc3598e5b9af4a2e2ae3bc (patch) | |
tree | 7de6d53667a5d680af08cb340d3d127dc7b62c1b /src | |
parent | f98f5c5432f13238fc640820cc222b671c1ee8df (diff) |
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')
-rw-r--r-- | src/gui/dialogs/qprintdialog_mac.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/dialogs/qprintdialog_mac.mm b/src/gui/dialogs/qprintdialog_mac.mm index a7587b185d..667fc406ea 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; |