URI header now returns pointers with ownership.

I've put `.release()` at most of the callsites, but this
gives me something to search for when taking the next
steps.
This commit is contained in:
2025-04-13 15:05:21 -04:00
parent c18a12d223
commit 61c879c218
23 changed files with 151 additions and 156 deletions

View File

@ -53,7 +53,7 @@ int a_History_add_url(DilloUrl *url)
_MSG("a_History_add_url: '%s' ", URL_STR(url));
for (i = 0; i < history_size; ++i)
if (!a_Url_cmp(history[i].url, url) &&
if (!a_Url_cmp(*history[i].url, *url) &&
!strcmp(URL_FRAGMENT(history[i].url), URL_FRAGMENT(url)))
break;
@ -63,7 +63,7 @@ int a_History_add_url(DilloUrl *url)
} else {
idx = history_size;
a_List_add(history, history_size, history_size_max, H_Item);
history[idx].url = a_Url_dup(url);
history[idx].url = a_Url_dup(*url).release();
history[idx].title = NULL;
++history_size;
_MSG("ADDED at idx=%d\n", idx);
@ -114,7 +114,7 @@ const char *a_History_get_title_by_url(const DilloUrl *url, int force)
dReturn_val_if_fail(url != NULL, NULL);
for (i = 0; i < history_size; ++i)
if (a_Url_cmp(url, history[i].url) == 0)
if (a_Url_cmp(*url, *history[i].url) == 0)
break;
if (i < history_size && history[i].title)
@ -134,7 +134,7 @@ void a_History_set_title_by_url(const DilloUrl *url, const char *title)
dReturn_if (url == NULL);
for (i = history_size - 1; i >= 0; --i)
if (a_Url_cmp(url, history[i].url) == 0)
if (a_Url_cmp(*url, *history[i].url) == 0)
break;
if (i >= 0) {