mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 04:58:06 +00:00
vo_opengl_cb: free context on exit
Minor memory leak. Actually, this also exposes some problems in the QtQuick example. This will have to be fixed in the example.
This commit is contained in:
parent
c640b8f3c0
commit
16a5971d28
@ -152,6 +152,9 @@ void mp_destroy(struct MPContext *mpctx)
|
||||
|
||||
mp_clients_destroy(mpctx);
|
||||
|
||||
talloc_free(mpctx->gl_cb_ctx);
|
||||
mpctx->gl_cb_ctx = NULL;
|
||||
|
||||
osd_free(mpctx->osd);
|
||||
|
||||
if (cas_terminal_owner(mpctx, mpctx)) {
|
||||
|
@ -79,10 +79,18 @@ struct mpv_opengl_cb_context {
|
||||
struct vo *active;
|
||||
};
|
||||
|
||||
static void free_ctx(void *ptr)
|
||||
{
|
||||
mpv_opengl_cb_context *ctx = ptr;
|
||||
|
||||
pthread_mutex_destroy(&ctx->lock);
|
||||
}
|
||||
|
||||
struct mpv_opengl_cb_context *mp_opengl_create(struct mpv_global *g,
|
||||
struct osd_state *osd)
|
||||
{
|
||||
mpv_opengl_cb_context *ctx = talloc_zero(NULL, mpv_opengl_cb_context);
|
||||
talloc_set_destructor(ctx, free_ctx);
|
||||
ctx->log = mp_log_new(ctx, g->log, "opengl-cb");
|
||||
pthread_mutex_init(&ctx->lock, NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user