From 6afdb260426fbc0a9edfa3c92b57a36ec3535f64 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 10 Mar 2015 13:19:32 -0700 Subject: [PATCH] let QMainWindow delete GLCanvas, just stop the QTimer instead --- interface/src/Application.cpp | 4 ++-- interface/src/GLCanvas.cpp | 4 ++++ interface/src/GLCanvas.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0182e6e195..c53f387518 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -604,8 +604,8 @@ Application::~Application() { ModelEntityItem::cleanupLoadedAnimations(); - delete _glWidget; - _glWidget = NULL; + // stop the glWidget frame timer so it doesn't call paintGL + _glWidget->stopFrameTimer(); DependencyManager::destroy(); DependencyManager::destroy(); diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index 10090de51a..b72c00c779 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -31,6 +31,10 @@ GLCanvas::GLCanvas() : QGLWidget(QGL::NoDepthBuffer | QGL::NoStencilBuffer), #endif } +void GLCanvas::stopFrameTimer() { + _frameTimer.stop(); +} + bool GLCanvas::isThrottleRendering() const { return _throttleRendering || Application::getInstance()->getWindow()->isMinimized(); } diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index e2bbf3b841..7b86f983e9 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -22,6 +22,8 @@ class GLCanvas : public QGLWidget { public: GLCanvas(); + + void stopFrameTimer(); bool isThrottleRendering() const;