summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2010-09-17 13:34:18 +0200
committerportix <portix@gmx.net>2010-09-17 13:34:18 +0200
commitea7000a3f33737ad8b5c10e7160d530c844fe5ef (patch)
tree315092a21a72b50010ba4efc09e2038fd9621c69
parentb716a657dab6367f1dbc98486711515cfad57955 (diff)
downloaddwb-ea7000a3f33737ad8b5c10e7160d530c844fe5ef.zip
save session on crash
-rw-r--r--src/dwb.c2
-rw-r--r--src/session.c3
-rw-r--r--src/session.h2
-rw-r--r--src/view.c1
4 files changed, 4 insertions, 4 deletions
diff --git a/src/dwb.c b/src/dwb.c
index 5c0a08a6..3441cd41 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -1928,7 +1928,7 @@ dwb_handle_signal(gint s) {
}
else if (s == SIGSEGV) {
fprintf(stderr, "Received SIGSEGV, try to clean up.\n");
- if (dwb_end()) {
+ if (dwb_session_save(NULL)) {
fprintf(stderr, "Success.\n");
}
exit(EXIT_FAILURE);
diff --git a/src/session.c b/src/session.c
index 38061b17..ed5a2a0f 100644
--- a/src/session.c
+++ b/src/session.c
@@ -119,7 +119,7 @@ dwb_session_restore(const gchar *name) {
}/*}}}*/
/* dwb_session_save(const gchar *) {{{*/
-void
+gboolean
dwb_session_save(const gchar *name) {
if (!name) {
name = "default";
@@ -156,4 +156,5 @@ dwb_session_save(const gchar *name) {
dwb_util_set_file_content(dwb.files.session, buffer->str);
g_string_free(buffer, true);
dwb_exit();
+ return true;
}/*}}}*/
diff --git a/src/session.h b/src/session.h
index 12466d46..d5c45fa3 100644
--- a/src/session.h
+++ b/src/session.h
@@ -1,7 +1,7 @@
#ifndef SESSION_H
#define SESSION_H
-void dwb_session_save(const gchar *);
+gboolean dwb_session_save(const gchar *);
gboolean dwb_session_restore(const gchar *);
void dwb_session_list(void);
diff --git a/src/view.c b/src/view.c
index d7bedc51..b521b45d 100644
--- a/src/view.c
+++ b/src/view.c
@@ -93,7 +93,6 @@ dwb_web_view_hovering_over_link_cb(WebKitWebView *web, gchar *title, gchar *uri,
else {
dwb_update_status_text(gl);
}
-
}/*}}}*/
/* dwb_web_view_mime_type_policy_cb {{{*/