]> git.sesse.net Git - pkanalytics/blobdiff - video_widget.cpp
Fix a crash on exit.
[pkanalytics] / video_widget.cpp
index 0bd910ce29f826e86e62629ad609158ca72e09a1..5d706ac3f55051080dd9b9bfbac97e0fb53b72a6 100644 (file)
@@ -249,6 +249,16 @@ VideoWidget::VideoWidget(QWidget *parent)
        connect(video_window, &VideoWindow::mouse_moved, this, &VideoWidget::mouseMoveEvent);
 }
 
+VideoWidget::~VideoWidget()
+{
+       stop();
+
+       // Qt will delete video_window for us after we're gone,
+       // so make sure its destructor does not try to mess with
+       // our freelist. The actual freelist frames will leak.
+       video_window->set_current_frame(nullptr);
+}
+
 GLuint compile_shader(const string &shader_src, GLenum type)
 {
        GLuint obj = glCreateShader(type);