]> git.sesse.net Git - nageru/commitdiff
Fix a context memory leak on cut.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 23 Apr 2016 22:31:00 +0000 (00:31 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 23 Apr 2016 22:31:00 +0000 (00:31 +0200)
context.cpp
context.h
quicksync_encoder.cpp

index 6ce57446b08983c670a3c7b7c99aaf452cc0fe61..ea576cd73ff09e6756e0b141bd693d7db8b35239 100644 (file)
@@ -35,3 +35,8 @@ bool make_current(QOpenGLContext *context, QSurface *surface)
 {
        return context->makeCurrent(surface);
 }
+
+void delete_context(QOpenGLContext *context)
+{
+       delete context;
+}
index 0c92a602716f263f4ad6237da871a84bb767f976..aeda12b61d950721ca6432f4415b3b0eb28fbbf5 100644 (file)
--- a/context.h
+++ b/context.h
@@ -11,3 +11,4 @@ extern QGLWidget *global_share_widget;
 QSurface *create_surface(const QSurfaceFormat &format);
 QOpenGLContext *create_context(const QSurface *surface);
 bool make_current(QOpenGLContext *context, QSurface *surface);
+void delete_context(QOpenGLContext *context);
index 41ace54263d1d235e8a02c4a905ac9fc34e8f3c0..fa00a3409f336bfd383c5afde67850207853614b 100644 (file)
@@ -1774,6 +1774,7 @@ QuickSyncEncoderImpl::QuickSyncEncoderImpl(const std::string &filename, QSurface
                        exit(1);
                }
                encode_thread_func();
+               delete_context(context);
        });
 }