From c1fa9c55bfce0a1dc1914be25d16a37bfb24fc62 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Sat, 12 Jul 2008 05:52:26 +0000 Subject: [PATCH] Bug 765: use load_uri to load the old tab's document to avoid crash Kalle reported that after commit 5c96d430c98d7b67cf397aac83cfdfa1788aa6df, 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. --- src/session/session.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/session/session.c b/src/session/session.c index 8c937306..191fbaa0 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -827,10 +827,12 @@ setup_session(struct session *ses, struct uri *uri, struct session *base) struct location *loc = mem_calloc(1, sizeof(*loc)); if (loc) { - loc->download.state = S_OK; 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); - render_document_frames(ses, 0); + load_uri(loc->vs.uri, NULL, &loc->download, PRI_MAIN, + CACHE_MODE_ALWAYS, -1); } } -- 2.11.4.GIT