From: Jean-Philippe Bruyère Date: Fri, 14 Oct 2022 01:58:09 +0000 (+0200) Subject: debug when context destroyed with remaining saved ctx X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=6c329acfb888d9a9aefd8e1cae6d7162c053e70b;p=jp%2Fvkvg.git debug when context destroyed with remaining saved ctx --- diff --git a/src/vkvg_context.c b/src/vkvg_context.c index ea5b1f5..a7738b9 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -234,8 +234,6 @@ void _clear_context (VkvgContext ctx) { vkvg_context_save_t* cur = next; next = cur->pNext; _free_ctx_save (cur); - if (cur->pattern) - vkvg_pattern_destroy (cur->pattern); } //free additional stencil use in save/restore process if (ctx->savedStencils) { diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index 42ad96d..5342117 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -1311,6 +1311,8 @@ bool ptInTriangle(vec2 p, vec2 p0, vec2 p1, vec2 p2) { void _free_ctx_save (vkvg_context_save_t* sav){ if (sav->dashCount > 0) free (sav->dashes); + if (sav->pattern) + vkvg_pattern_destroy(sav->pattern); free (sav); }