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;