From: Marco Rubin <20150305+Rubo3@users.noreply.github.com> Date: Sun, 27 Feb 2022 17:15:53 +0000 (+0000) Subject: Surface refs increment/decrement on context creation/destruction (#96) X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=2ad64b031b3d02f84274b808bfd0faf651842592;p=jp%2Fvkvg.git Surface refs increment/decrement on context creation/destruction (#96) Increment/decrement surf ref on create/destroy --- diff --git a/src/vkvg_context.c b/src/vkvg_context.c index ead2f0e..9b77922 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -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;