]> O.S.I.I.S - jp/vkvg.git/commitdiff
Surface refs increment/decrement on context creation/destruction (#96)
authorMarco Rubin <20150305+Rubo3@users.noreply.github.com>
Sun, 27 Feb 2022 17:15:53 +0000 (17:15 +0000)
committerGitHub <noreply@github.com>
Sun, 27 Feb 2022 17:15:53 +0000 (18:15 +0100)
Increment/decrement surf ref on create/destroy

src/vkvg_context.c

index ead2f0ef1e2ebf307dbb9a35c5f6f86b42d790ad..9b77922e6e866354392ec524c5549294ab3b4a0e 100644 (file)
@@ -67,6 +67,7 @@ void _init_ctx (VkvgContext ctx) {
                ctx->renderPassBeginInfo.renderPass = ctx->dev->renderPass_ClearStencil;
 
        ctx->pSurf->new = false;
+       vkvg_surface_reference (ctx->pSurf);
 
        if (ctx->dev->samples == VK_SAMPLE_COUNT_1_BIT)
                ctx->renderPassBeginInfo.clearValueCount = 2;
@@ -294,6 +295,8 @@ void vkvg_destroy (VkvgContext ctx)
                mtx_unlock (&ctx->dev->mutex);
 #endif
 
+       vkvg_surface_destroy(ctx->pSurf);
+
        if (!ctx->status && ctx->dev->cachedContextCount < VKVG_MAX_CACHED_CONTEXT_COUNT) {
                _device_store_context (ctx);
                return;