Add guards when checking vsync

This commit is contained in:
Zach Pomerantz 2016-03-24 15:14:00 -07:00
parent a34e6773a9
commit 1405daa4ee

View file

@ -50,7 +50,9 @@ void GLWidget::initializeGL() {
// TODO: write the proper code for linux
makeCurrent();
#if defined(Q_OS_WIN)
_vsyncSupported = context()->contextHandle()->hasExtension("WGL_EXT_swap_control");;
if (isValid() && context() && context()->contextHandle()) {
_vsyncSupported = context()->contextHandle()->hasExtension("WGL_EXT_swap_control");;
}
#endif
}