From 19102780936477fa805fe97d5cbea0927b8249d9 Mon Sep 17 00:00:00 2001 From: portix Date: Sun, 27 Feb 2011 13:07:40 +0100 Subject: fix segfault when saving a session --- src/session.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/session.c') diff --git a/src/session.c b/src/session.c index b9ee71c2..8917db71 100644 --- a/src/session.c +++ b/src/session.c @@ -144,16 +144,14 @@ dwb_session_save(const char *name) { GString *buffer = g_string_new(NULL); g_string_append_printf(buffer, "g:%s\n", name); - int view=0; - for (GList *l = g_list_last(dwb.state.views); l; l=l->prev, view++) { + for (GList *l = g_list_last(dwb.state.views); l; l=l->prev) { WebKitWebView *web = WEBVIEW(l); WebKitWebBackForwardList *bf_list = webkit_web_view_get_back_forward_list(web); for (int i= -webkit_web_back_forward_list_get_back_length(bf_list); i<=webkit_web_back_forward_list_get_forward_length(bf_list); i++) { WebKitWebHistoryItem *item = webkit_web_back_forward_list_get_nth_item(bf_list, i); if (item) { - const char *uri = webkit_web_history_item_get_uri(item); - const char *title = webkit_web_history_item_get_title(item); - g_string_append_printf(buffer, "%d %s %s\n", i, uri, title); + g_string_append_printf(buffer, "%d %s %s\n", + i, webkit_web_history_item_get_uri(item), webkit_web_history_item_get_title(item)); } } } @@ -172,6 +170,5 @@ dwb_session_save(const char *name) { } dwb_util_set_file_content(dwb.files.session, buffer->str); g_string_free(buffer, true); - //dwb_exit(); return true; }/*}}}*/ -- cgit v1.2.3