]> git.sesse.net Git - nageru/blobdiff - glwidget.cpp
Fix crashes on exit.
[nageru] / glwidget.cpp
index 27f290db351b755d7e255c174f7ca468589ef624..fb5fe995719b36112edc8eef315a06ad05a31aa5 100644 (file)
@@ -40,12 +40,17 @@ GLWidget::GLWidget(QWidget *parent)
 {
 }
 
-void GLWidget::clean_context()
+GLWidget::~GLWidget()
+{
+}
+
+void GLWidget::shutdown()
 {
        if (resource_pool != nullptr) {
                makeCurrent();
                resource_pool->clean_context();
        }
+       global_mixer->remove_frame_ready_callback(output, this);
 }
 
 void GLWidget::initializeGL()
@@ -57,7 +62,7 @@ void GLWidget::initializeGL()
                global_mainwindow->mixer_created(global_mixer);
                global_mixer->start();
        });
-       global_mixer->set_frame_ready_callback(output, [this]{
+       global_mixer->add_frame_ready_callback(output, this, [this]{
                QMetaObject::invokeMethod(this, "update", Qt::AutoConnection);
        });
        if (output == Mixer::OUTPUT_LIVE) {