Fix with-app cleanup --> to head
Wed Mar 10 18:13:52 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Delete QPainDevices before the QApplication is destroyed.
Mon Jan 25 20:09:40 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix with-app cleanup
diff -rN -u old-qt.gui/src/application.lisp new-qt.gui/src/application.lisp
--- old-qt.gui/src/application.lisp 2014-10-30 07:40:48.000000000 +0100
+++ new-qt.gui/src/application.lisp 2014-10-30 07:40:48.000000000 +0100
@@ -2,7 +2,7 @@
(defvar *widgets* nil)
-(defmethod delete-app :around ((application qt:application))
+(defmethod cl-smoke.qt.core:delete-app :around ((application qt:application))
(qt:application.close-all-windows)
;; widgets are only valid as long, as an application object
;; exists. QApplication::~QApplication() deletes all widgets in
@@ -11,6 +11,13 @@
;; see: qt4/src/gui/kernel/qapplication.cpp
(loop for widget across (qt:application.all-widgets) do
(tg:cancel-finalization widget))
+ ;; QPaintDevices are only valid when a application object exists.
+ (loop for object being the hash-values of smoke::*object-map* do
+ (when (typep object 'qt:paint-device)
+ (delete-object object)))
+ ;; Finalize other stuff before deleting the QApplication,
+ ;; e.g. QGraphicsScene
+ (tg:gc :full t)
(call-next-method)
(setf *widgets* nil))