From b8f07cf85ebbef7a01f7083703131fe43ce92863ed5de392eadd12c2d1cd0ea3 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 6 May 2026 02:19:56 -0400 Subject: [PATCH] SVG backing is now a C++ object. --- src/svg.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/svg.cc b/src/svg.cc index 3d48557..4e23383 100644 --- a/src/svg.cc +++ b/src/svg.cc @@ -30,13 +30,13 @@ #define NANOSVGRAST_IMPLEMENTATION #include "nanosvgrast.h" -typedef struct { +struct DilloSvg { DilloImage *Image; /* Image meta data */ DilloUrl *url; /* Primary Key for the dicache */ int version; /* Secondary Key for the dicache */ int bgcolor; /* Parent widget background color */ int fgcolor; /* Parent widget foreground color */ -} DilloSvg; +}; /* * Free up the resources for this image. @@ -45,7 +45,7 @@ static void Svg_free(DilloSvg *svg) { _MSG("Svg_free: svg=%p\n", svg); - dFree(svg); + delete svg; } /* @@ -153,7 +153,7 @@ extern "C" void a_Svg_callback(int Op, CacheClient_t *data) */ void *a_Svg_new(DilloImage *Image, DilloUrl *url, int version) { - DilloSvg *svg = dNew0(DilloSvg, 1); + DilloSvg *svg = std::make_unique< DilloSvg >().release(); _MSG("a_Svg_new: svg=%p\n", svg); svg->Image = Image;