Index: uml.cpp
===================================================================
--- uml.cpp	(revision 1266324)
+++ uml.cpp	(working copy)
@@ -138,6 +138,8 @@
     m_doc = new UMLDoc();
     m_doc->init();
     m_hasBegunMacro = false;
+    m_printer = new QPrinter;
+    m_printer->setFullPage(true);
 
     readOptionState();
     initActions();
@@ -192,6 +194,7 @@
     delete m_copyTimer;
     delete m_refactoringAssist;
     delete m_pUndoStack;
+    delete m_printer;
 }
 
 /**
@@ -1268,12 +1271,9 @@
  */
 void UMLApp::slotPrintPreview()
 {
-    QPrinter printer;
-    printer.setFullPage(true);
-
     slotStatusMsg(i18n("Print Preview..."));
 
-    QPrintPreviewDialog *preview = new QPrintPreviewDialog(&printer,this);
+    QPrintPreviewDialog *preview = new QPrintPreviewDialog(m_printer,this);
     connect(preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(slotPrintPreviewPaintRequested(QPrinter *)));
     preview->exec();
 }
@@ -1300,11 +1300,11 @@
 
     DiagramPrintPage * selectPage = new DiagramPrintPage(0, m_doc);
     QPrintDialog *printDialog =
-                  KdePrint::createPrintDialog(&printer, QList<QWidget*>() << selectPage, this);
+                  KdePrint::createPrintDialog(m_printer, QList<QWidget*>() << selectPage, this);
     printDialog->setWindowTitle(i18n("Print %1", m_doc->url().prettyUrl()));
 
     if (printDialog->exec()) {
-        m_doc->print(&printer, selectPage);
+        m_doc->print(m_printer, selectPage);
     }
     delete printDialog;
     resetStatusMsg();
Index: uml.h
===================================================================
--- uml.h	(revision 1266324)
+++ uml.h	(working copy)
@@ -414,7 +414,7 @@
     StatusBarToolButton* m_pZoomFullSBTB;
     QSlider* m_pZoomSlider;
     QLabel* m_statusBarMessage;
-
+    QPrinter *m_printer;
     /**
      * The running XHTML documentation generator. Null when no generation is running.
      */
