A bit more RAII for DilloHtml...

This commit is contained in:
2025-08-01 01:47:08 -04:00
parent b82eab34cf
commit eeb3db8bfd
6 changed files with 11 additions and 21 deletions

View File

@ -353,10 +353,8 @@ static void Menu_popup_cb(void *data)
* Page popup menu (construction & popup)
*/
void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url,
bool_t has_bugs, void *v_cssUrls)
bool_t has_bugs, std::vector< std::unique_ptr< DilloUrl > > *cssUrls)
{
lout::misc::SimpleVector <DilloUrl*> *cssUrls =
(lout::misc::SimpleVector <DilloUrl*> *) v_cssUrls;
int j = 0;
static Fl_Menu_Item *stylesheets = NULL;
@ -402,7 +400,7 @@ void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url,
memset(stylesheets, '\0', (cssUrls->size() + 1) * sizeof(Fl_Menu_Item));
for (j = 0; j < cssUrls->size(); j++) {
DilloUrl *url = cssUrls->get(j);
DilloUrl *url = cssUrls->at(j).get();
const char *url_str = URL_STR(url);
const uint_t head_length = 30, tail_length = 40,
url_len = strlen(url_str);