From 4093da9640f67dfe25cce0fed623f097aaa55edd68fed8d0f0ba5de366b0ac48 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 30 Jul 2025 11:09:16 -0400 Subject: [PATCH] Use new/delete for another struct --- src/web.cc | 4 ++-- src/web.hh | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/web.cc b/src/web.cc index 8dd1e46..82c94d4 100644 --- a/src/web.cc +++ b/src/web.cc @@ -122,7 +122,7 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web, DilloWeb* a_Web_new(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester) { - DilloWeb *web= dNew(DilloWeb, 1); + DilloWeb *web= new DilloWeb; _MSG(" a_Web_new: ValidWebs ==> %d\n", dList_length(ValidWebs)); web->url = a_Url_dup(url).release(); @@ -159,6 +159,6 @@ void a_Web_free(DilloWeb *web) dFree(web->filename); dList_remove(ValidWebs, (void *)web); _MSG("a_Web_free: ValidWebs=%d\n", dList_length(ValidWebs)); - dFree(web); + delete web; } diff --git a/src/web.hh b/src/web.hh index 7c46cd8..b687aeb 100644 --- a/src/web.hh +++ b/src/web.hh @@ -18,9 +18,8 @@ extern "C" { #define WEB_Download 8 /* Half implemented... */ -typedef struct _DilloWeb DilloWeb; -struct _DilloWeb { +struct DilloWeb { DilloUrl *url; /**< Requested URL */ DilloUrl *requester; /**< URL that caused this request, or **< NULL if user-initiated. */