summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-06-11 12:47:21 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-06-11 12:55:34 (GMT)
commitcde3f39cb75ba69185cca8176ea7126f8441f042 (patch)
treeaafc9a816ce6a55e4ad6ba999d2a6d2d8e4be1f1 /src/gui/kernel/qwidget_mac.mm
parent9a16161889c7f6c15c4d5679148a28fe51f95abb (diff)
downloadQt-cde3f39cb75ba69185cca8176ea7126f8441f042.zip
Qt-cde3f39cb75ba69185cca8176ea7126f8441f042.tar.gz
Qt-cde3f39cb75ba69185cca8176ea7126f8441f042.tar.bz2
Fixed an on-exit crash for apps using GL.
If a QGLWidget is left on the heap when the QApplication destructor is called, it will leave the QGLWidget in a broken state. The widget itself is released and set to a non-created state, which the associated QGLContext doesn't get notified about. With this patch the QGLWidget knows when QWidget::destroy() is called and can act acordingly. Task-number: QT-3498, QTBUG-10995 Reviewed-by: Paul
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 1928599..280712a 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2688,6 +2688,7 @@ QWidget::macCGHandle() const
void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
{
Q_D(QWidget);
+ d->aboutToDestroy();
if (!isWindow() && parentWidget())
parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry()));
d->deactivateWidgetCleanup();
@@ -3994,10 +3995,10 @@ static void qt_mac_update_widget_position(QWidget *q, QRect oldRect, QRect newRe
(oldRect.isValid() == false || newRect.isValid() == false) ||
// the position update is a part of a drag-and-drop operation
- QDragManager::self()->object ||
-
- // we are on Panther (no HIViewSetNeedsDisplayInRect)
- QSysInfo::MacintoshVersion < QSysInfo::MV_10_4
+ QDragManager::self()->object ||
+
+ // we are on Panther (no HIViewSetNeedsDisplayInRect)
+ QSysInfo::MacintoshVersion < QSysInfo::MV_10_4
){
HIViewSetFrame(view, &bounds);
return;