Browser window owns a few more things.
This commit is contained in:
11
src/bw.cc
11
src/bw.cc
@ -96,7 +96,6 @@ BrowserWindow::~BrowserWindow()
|
|||||||
dList_free(this->ImageClients);
|
dList_free(this->ImageClients);
|
||||||
dList_free(this->Docs);
|
dList_free(this->Docs);
|
||||||
|
|
||||||
delete this->nav_expect_url;
|
|
||||||
//for (j = 0; j < dList_length(this->PageUrls); ++j)
|
//for (j = 0; j < dList_length(this->PageUrls); ++j)
|
||||||
//delete reinterpret_cast< DilloUrl * >( dList_nth_data(this->PageUrls, j) );
|
//delete reinterpret_cast< DilloUrl * >( dList_nth_data(this->PageUrls, j) );
|
||||||
//dList_free(this->PageUrls);
|
//dList_free(this->PageUrls);
|
||||||
@ -105,8 +104,6 @@ BrowserWindow::~BrowserWindow()
|
|||||||
dFree(dList_nth_data(this->nav_stack, j));
|
dFree(dList_nth_data(this->nav_stack, j));
|
||||||
dList_free(this->nav_stack);
|
dList_free(this->nav_stack);
|
||||||
|
|
||||||
delete this->meta_refresh_url;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -317,14 +314,12 @@ BrowserWindow *a_Bw_get(int i)
|
|||||||
|
|
||||||
void a_Bw_expect(BrowserWindow *bw, const DilloUrl *url)
|
void a_Bw_expect(BrowserWindow *bw, const DilloUrl *url)
|
||||||
{
|
{
|
||||||
delete bw->nav_expect_url;
|
bw->nav_expect_url = a_Url_dup(url);
|
||||||
bw->nav_expect_url = a_Url_dup(url).release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void a_Bw_cancel_expect(BrowserWindow *bw)
|
void a_Bw_cancel_expect(BrowserWindow *bw)
|
||||||
{
|
{
|
||||||
delete bw->nav_expect_url;
|
bw->nav_expect_url.reset();
|
||||||
bw->nav_expect_url = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool_t a_Bw_expecting(BrowserWindow *bw)
|
bool_t a_Bw_expecting(BrowserWindow *bw)
|
||||||
@ -334,6 +329,6 @@ bool_t a_Bw_expecting(BrowserWindow *bw)
|
|||||||
|
|
||||||
const DilloUrl *a_Bw_expected_url(BrowserWindow *bw)
|
const DilloUrl *a_Bw_expected_url(BrowserWindow *bw)
|
||||||
{
|
{
|
||||||
return bw->nav_expect_url;
|
return bw->nav_expect_url.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ struct BrowserWindow {
|
|||||||
/** When the user clicks a link, the URL isn't pushed directly to history;
|
/** When the user clicks a link, the URL isn't pushed directly to history;
|
||||||
* nav_expect_url holds it until a dw is assigned to it. Only then an entry
|
* nav_expect_url holds it until a dw is assigned to it. Only then an entry
|
||||||
* is made in history and referenced at the top of nav_stack */
|
* is made in history and referenced at the top of nav_stack */
|
||||||
DilloUrl *nav_expect_url;
|
std::unique_ptr< DilloUrl > nav_expect_url;
|
||||||
|
|
||||||
/** Counter for the number of hops on a redirection. Used to stop
|
/** Counter for the number of hops on a redirection. Used to stop
|
||||||
* redirection loops (accounts for WEB_RootUrl only) */
|
* redirection loops (accounts for WEB_RootUrl only) */
|
||||||
@ -70,7 +70,7 @@ struct BrowserWindow {
|
|||||||
|
|
||||||
/** Url for zero-delay redirections in the META element */
|
/** Url for zero-delay redirections in the META element */
|
||||||
int meta_refresh_status;
|
int meta_refresh_status;
|
||||||
DilloUrl *meta_refresh_url;
|
std::unique_ptr< DilloUrl > meta_refresh_url;
|
||||||
|
|
||||||
/** HTML-bugs detected at parse time */
|
/** HTML-bugs detected at parse time */
|
||||||
int num_page_bugs;
|
int num_page_bugs;
|
||||||
|
|||||||
10
src/nav.cc
10
src/nav.cc
@ -405,10 +405,9 @@ static void Nav_redirection0_callback(void *data)
|
|||||||
|
|
||||||
if (bw->meta_refresh_status == 2) {
|
if (bw->meta_refresh_status == 2) {
|
||||||
Nav_stack_move_ptr(bw, -1);
|
Nav_stack_move_ptr(bw, -1);
|
||||||
a_Nav_push(bw, bw->meta_refresh_url, referer_url);
|
a_Nav_push(bw, bw->meta_refresh_url.get(), referer_url);
|
||||||
}
|
}
|
||||||
delete bw->meta_refresh_url;
|
bw->meta_refresh_url.reset();
|
||||||
bw->meta_refresh_url = NULL;
|
|
||||||
bw->meta_refresh_status = 0;
|
bw->meta_refresh_status = 0;
|
||||||
a_Timeout_remove();
|
a_Timeout_remove();
|
||||||
}
|
}
|
||||||
@ -421,9 +420,8 @@ void a_Nav_redirection0(BrowserWindow *bw, const DilloUrl *new_url)
|
|||||||
dReturn_if_fail (bw != NULL);
|
dReturn_if_fail (bw != NULL);
|
||||||
_MSG(">>>> a_Nav_redirection0 <<<<\n");
|
_MSG(">>>> a_Nav_redirection0 <<<<\n");
|
||||||
|
|
||||||
delete bw->meta_refresh_url;
|
bw->meta_refresh_url = a_Url_dup(new_url);
|
||||||
bw->meta_refresh_url = a_Url_dup(new_url).release();
|
a_Url_set_flags(bw->meta_refresh_url.get(),
|
||||||
a_Url_set_flags(bw->meta_refresh_url,
|
|
||||||
URL_FLAGS(new_url)|URL_E2EQuery|URL_IgnoreScroll);
|
URL_FLAGS(new_url)|URL_E2EQuery|URL_IgnoreScroll);
|
||||||
bw->meta_refresh_status = 2;
|
bw->meta_refresh_status = 2;
|
||||||
a_Timeout_add(0.0, Nav_redirection0_callback, (void*)bw);
|
a_Timeout_add(0.0, Nav_redirection0_callback, (void*)bw);
|
||||||
|
|||||||
Reference in New Issue
Block a user