From: Steinar H. Gunderson Date: Sat, 23 Apr 2016 22:31:00 +0000 (+0200) Subject: Fix a context memory leak on cut. X-Git-Tag: 1.3.0~57 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=8b098c0c040147d98db10ed6e1e817ac2d39e377 Fix a context memory leak on cut. --- diff --git a/context.cpp b/context.cpp index 6ce5744..ea576cd 100644 --- a/context.cpp +++ b/context.cpp @@ -35,3 +35,8 @@ bool make_current(QOpenGLContext *context, QSurface *surface) { return context->makeCurrent(surface); } + +void delete_context(QOpenGLContext *context) +{ + delete context; +} diff --git a/context.h b/context.h index 0c92a60..aeda12b 100644 --- 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); diff --git a/quicksync_encoder.cpp b/quicksync_encoder.cpp index 41ace54..fa00a34 100644 --- a/quicksync_encoder.cpp +++ b/quicksync_encoder.cpp @@ -1774,6 +1774,7 @@ QuickSyncEncoderImpl::QuickSyncEncoderImpl(const std::string &filename, QSurface exit(1); } encode_thread_func(); + delete_context(context); }); }