diff options
author | Mason Larobina <mason.larobina@gmail.com> | 2010-03-01 01:16:03 +0800 |
---|---|---|
committer | Mason Larobina <mason.larobina@gmail.com> | 2010-03-01 01:16:03 +0800 |
commit | e63d10759211b6fc96626f2c9c100b45e550ca69 (patch) | |
tree | 1212938cb6bbb373b662c11f5fb09904fa035afc /src/uzbl-core.c | |
parent | 770c910b4dd7b49df881812deea4b2c505985473 (diff) |
Segfaulting when uzbl.behave.commands hash table already destroyed.
Diffstat (limited to 'src/uzbl-core.c')
-rw-r--r-- | src/uzbl-core.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 6cf8b10..c288b5f 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -502,7 +502,10 @@ clean_up(void) { g_free(uzbl.info.pid_str); g_free(uzbl.state.executable_path); - g_hash_table_destroy(uzbl.behave.commands); + if (uzbl.behave.commands) { + g_hash_table_destroy(uzbl.behave.commands); + uzbl.behave.commands = NULL; + } if(uzbl.state.event_buffer) g_ptr_array_free(uzbl.state.event_buffer, TRUE); @@ -1084,9 +1087,9 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result, const char *fi size_t size; JSStringRef prop, val; JSObjectRef exc = JSValueToObject(context, js_exc, NULL); - + printf("Exception occured while executing script:\n"); - + /* Print file */ prop = JSStringCreateWithUTF8CString("sourceURL"); val = JSValueToStringCopy(context, JSObjectGetProperty(context, exc, prop, NULL), NULL); @@ -1110,7 +1113,7 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result, const char *fi } JSStringRelease(prop); JSStringRelease(val); - + /* Print message */ val = JSValueToStringCopy(context, exc, NULL); size = JSStringGetMaximumUTF8CStringSize(val); |