diff options
author | portix <none@none> | 2013-01-19 02:22:01 +0100 |
---|---|---|
committer | portix <none@none> | 2013-01-19 02:22:01 +0100 |
commit | 6a33d0940448e18653904a841e295983644ca9c5 (patch) | |
tree | 37bc5c440c629ba64b0592e0d76d88fc559a4feb /src/dwb.c | |
parent | 3f669c5a0e420436146921bc8eaeb164b818e466 (diff) | |
download | dwb-6a33d0940448e18653904a841e295983644ca9c5.zip |
Call scripts_end before freeing anything else in dwb_clean_up, otherwise 'execute' can cause a segfault
Diffstat (limited to 'src/dwb.c')
-rw-r--r-- | src/dwb.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -3492,7 +3492,14 @@ dwb_free_custom_keys() gboolean dwb_clean_up() { - for (GList *l = dwb.keymap; l; l=l->next) { + for (GList *gl = dwb.state.views; gl; gl=gl->next) + view_clean(gl); + // needs to be ended before anything else is freed, otherwise pending + // 'execute' can crash + scripts_end(); + + for (GList *l = dwb.keymap; l; l=l->next) + { KeyMap *m = l->data; if (m->map->prop & CP_SCRIPT) scripts_unbind(m->map->arg.p); @@ -3525,10 +3532,6 @@ dwb_clean_up() dwb_free_list(dwb.fc.pers_scripts, (void_func)g_free); dwb_free_custom_keys(); - for (GList *gl = dwb.state.views; gl; gl=gl->next) - view_clean(gl); - - dwb_soup_end(); adblock_end(); domain_end(); @@ -3537,10 +3540,8 @@ dwb_clean_up() for (int i=FILES_FIRST; i<FILES_LAST; i++) g_free(dwb.files[i]); - gtk_widget_destroy(dwb.gui.window); - scripts_end(); return true; }/*}}}*/ |