From 24d68c53e350fa349dd4e668163fa7d2e040c6ab285fde819b9296d7515410ec Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Fri, 9 Jan 2026 15:53:32 -0500 Subject: [PATCH] ValidWebs is now a vector. --- src/web.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/web.cc b/src/web.cc index dfed11d..83c85bc 100644 --- a/src/web.cc +++ b/src/web.cc @@ -29,7 +29,7 @@ using namespace dw::core; /* * Local data */ -static Dlist *ValidWebs; /* Active web structures list; it holds +static std::vector< DilloWeb * > ValidWebs; /* Active web structures list; it holds * pointers to DilloWeb structures. */ /* @@ -37,7 +37,6 @@ static Dlist *ValidWebs; /* Active web structures list; it holds */ void a_Web_init(void) { - ValidWebs = dList_new(32); } /** @@ -134,7 +133,7 @@ std::unique_ptr< DilloWeb > a_Web_new(BrowserWindow *bw, const DilloUrl *url, web->SavedBytes = 0; web->bgColor = 0x000000; /* Dummy value will be overwritten * in a_Web_dispatch_by_type. */ - dList_append(ValidWebs, (void *)web.get()); + ValidWebs.push_back( web.get() ); return web; } @@ -143,7 +142,7 @@ std::unique_ptr< DilloWeb > a_Web_new(BrowserWindow *bw, const DilloUrl *url, */ int a_Web_valid(DilloWeb *web) { - return (dList_find(ValidWebs, web) != NULL); + return std::find( begin( ValidWebs ), end( ValidWebs ), web ) != end( ValidWebs ); } /** @@ -151,7 +150,8 @@ int a_Web_valid(DilloWeb *web) */ DilloWeb::~DilloWeb() { - dList_remove(ValidWebs, (void *)this); - _MSG("a_Web_free: ValidWebs=%d\n", dList_length(ValidWebs)); + auto where= std::find( begin( ValidWebs ), end( ValidWebs ), this ); + ValidWebs.erase( where ); + _MSG("a_Web_free: ValidWebs=%d\n", ValidWebs.size()); }