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(); ModelEntityItem::cleanupLoadedAnimations();
delete _glWidget; // stop the glWidget frame timer so it doesn't call paintGL
_glWidget = NULL; _glWidget->stopFrameTimer();
DependencyManager::destroy<AnimationCache>(); DependencyManager::destroy<AnimationCache>();
DependencyManager::destroy<TextureCache>(); DependencyManager::destroy<TextureCache>();

View file

@ -31,6 +31,10 @@ GLCanvas::GLCanvas() : QGLWidget(QGL::NoDepthBuffer | QGL::NoStencilBuffer),
#endif #endif
} }
void GLCanvas::stopFrameTimer() {
_frameTimer.stop();
}
bool GLCanvas::isThrottleRendering() const { bool GLCanvas::isThrottleRendering() const {
return _throttleRendering || Application::getInstance()->getWindow()->isMinimized(); return _throttleRendering || Application::getInstance()->getWindow()->isMinimized();
} }

View file

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