diff options
author | portix <portix@gmx.net> | 2011-02-27 13:07:40 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2011-02-27 13:07:40 +0100 |
commit | 19102780936477fa805fe97d5cbea0927b8249d9 (patch) | |
tree | effad54cd71ffdd3dbc248b3ffbdedaf49aba0b6 /src/session.c | |
parent | 4df74e5c36c48d0bba5a2d094dbe2f7d2e2bdeeb (diff) | |
download | dwb-19102780936477fa805fe97d5cbea0927b8249d9.zip |
fix segfault when saving a session
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 9 |
1 files changed, 3 insertions, 6 deletions
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; }/*}}}*/ |