Commit 87dfdabf authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

fix crash

parent d901cab7
......@@ -106,7 +106,7 @@ void dtkVisualizationViewVideoGLPrivate::setVersion(int major, int minor, bool d
this->context->setFormat(format);
this->context->create();
if (QOpenGLWidget::context()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
if (this->context->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
qDebug() << Q_FUNC_INFO << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << this->context->format();
qDebug() << Q_FUNC_INFO << this->context->surface();
......@@ -204,7 +204,7 @@ void dtkVisualizationViewVideoGLPrivate::initializeGL(void)
qDebug() << Q_FUNC_INFO << 1 << this->context->format();
qDebug() << "--------------------------------------------";
}
QOpenGLFunctions::initializeOpenGLFunctions();
createShaderProgram();
......@@ -268,7 +268,7 @@ void dtkVisualizationViewVideoGLPrivate::paintGL(void)
qDebug() << " THIS context:" << this->context->format();
qDebug() << "------------------------------------------";
}
if(this->buffer.isNull())
return;
......@@ -343,7 +343,7 @@ dtkVisualizationViewVideoGL::dtkVisualizationViewVideoGL(QWidget *parent) : dtkW
d = new dtkVisualizationViewVideoGLPrivate(this);
d->q = this;
d->setVersion(4, 3, true);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
......@@ -361,12 +361,14 @@ void dtkVisualizationViewVideoGL::setVersion( int major, int minor, bool debug)
QWidget *dtkVisualizationViewVideoGL::widget(void)
{
if (d->QOpenGLWidget::context()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
QOpenGLContext *context = d->QOpenGLWidget::context();
if (context && context->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
qDebug() << Q_FUNC_INFO << d->context << d->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << d->format();
qDebug() << "--------------------------------------------";
}
return d;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment