Merge pull request #4408 from birarda/master

let QMainWindow delete GLCanvas, just stop the QTimer instead
This commit is contained in:
Brad Hefta-Gaub 2015-03-10 13:41:36 -07:00
commit d59f9c85a3
3 changed files with 8 additions and 2 deletions

View file

@ -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<AnimationCache>();
DependencyManager::destroy<TextureCache>();

View file

@ -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();
}

View file

@ -22,6 +22,8 @@ class GLCanvas : public QGLWidget {
public:
GLCanvas();
void stopFrameTimer();
bool isThrottleRendering() const;