1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Bug 765: use load_uri to load old tab's document

Kalle reported that after commit 5c96d430c9,
ELinks would crash if the document in the old tab was still loading when a
new tab was opened.  The problem was that the new session's download.data
pointer was not updated to point to the session as doc_loading_callback
expects.

Instead of just calling render_document_frames, set up the download and
call load_uri.
(cherry picked from commit d6116ca83a)
This commit is contained in:
Miciah Dashiel Butler Masters 2008-07-12 05:52:26 +00:00 committed by Kalle Olavi Niemitalo
parent f4a231cb9a
commit f5103d0cc0

View File

@ -851,10 +851,12 @@ setup_session(struct session *ses, struct uri *uri, struct session *base)
struct location *loc = mem_calloc(1, sizeof(*loc)); struct location *loc = mem_calloc(1, sizeof(*loc));
if (loc) { if (loc) {
loc->download.state = connection_state(S_OK);
copy_location(loc, cur_loc(base)); copy_location(loc, cur_loc(base));
loc->download.data = ses;
loc->download.callback = (download_callback_T *) doc_loading_callback;
add_to_history(&ses->history, loc); add_to_history(&ses->history, loc);
render_document_frames(ses, 0); load_uri(loc->vs.uri, NULL, &loc->download, PRI_MAIN,
CACHE_MODE_ALWAYS, -1);
} }
} }