DilloURL has a dtor.
It is the same as the original free function. But this will let me put some ownership on various members and slowly start to C++ify this core type.
This commit is contained in:
14
src/cache.cc
14
src/cache.cc
@ -127,7 +127,7 @@ void a_Cache_init(void)
|
||||
Dstr *ds = dStr_new(AboutSplash);
|
||||
Cache_entry_inject(url, ds);
|
||||
dStr_free(ds, 1);
|
||||
a_Url_free(url);
|
||||
delete url;
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,13 +298,13 @@ static void Cache_auth_free(Dlist *auth)
|
||||
*/
|
||||
static void Cache_entry_free(CacheEntry_t *entry)
|
||||
{
|
||||
a_Url_free((DilloUrl *)entry->Url);
|
||||
delete const_cast< DilloUrl * >( entry->Url );
|
||||
dFree(entry->TypeDet);
|
||||
dFree(entry->TypeHdr);
|
||||
dFree(entry->TypeMeta);
|
||||
dFree(entry->TypeNorm);
|
||||
dStr_free(entry->Header, TRUE);
|
||||
a_Url_free((DilloUrl *)entry->Location);
|
||||
delete const_cast< DilloUrl * >( entry->Location );
|
||||
Cache_auth_free(entry->Auth);
|
||||
dStr_free(entry->Data, 1);
|
||||
dStr_free(entry->UTF8Data, 1);
|
||||
@ -1030,7 +1030,7 @@ static int Cache_redirect(CacheEntry_t *entry, int Flags, BrowserWindow *bw)
|
||||
if (entry->Flags & CA_TempRedirect)
|
||||
a_Url_set_flags(NewUrl, URL_FLAGS(NewUrl) | URL_E2EQuery);
|
||||
a_Nav_push(bw, NewUrl, entry->Url);
|
||||
a_Url_free(NewUrl);
|
||||
delete NewUrl;
|
||||
} else {
|
||||
/* Sub entity redirection (most probably an image) */
|
||||
if (!entry->Data->len) {
|
||||
@ -1058,7 +1058,7 @@ static void Cache_auth_callback(void *vdata)
|
||||
if (a_Auth_do_auth(data->auth, data->url))
|
||||
a_Nav_reload(data->bw);
|
||||
Cache_auth_free(data->auth);
|
||||
a_Url_free(data->url);
|
||||
delete data->url;
|
||||
dFree(data);
|
||||
Cache_auth_entry(NULL, NULL);
|
||||
a_Timeout_remove();
|
||||
@ -1136,7 +1136,7 @@ static void Cache_savelink_cb(void *vdata)
|
||||
Cache_savelink_t *data = (Cache_savelink_t*) vdata;
|
||||
|
||||
a_UIcmd_save_link(data->bw, data->url);
|
||||
a_Url_free(data->url);
|
||||
delete data->url;
|
||||
dFree(data);
|
||||
}
|
||||
|
||||
@ -1342,7 +1342,7 @@ static CacheEntry_t *Cache_process_queue(CacheEntry_t *entry)
|
||||
a_Timeout_add(0.0, Cache_savelink_cb, data);
|
||||
}
|
||||
}
|
||||
a_Url_free(url);
|
||||
delete url;
|
||||
} else if (entry->Auth && !(entry->Flags & CA_InProgress)) {
|
||||
Cache_auth_entry(entry, Client_bw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user