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-12 13:33:32 +0800 |
commit | 38ef86e4d1827338495ff52fb25a6808cf4e45d2 (patch) | |
tree | 6234c3b22d6757e18957e35ba60087a5457a0b42 | |
parent | bf586a5e306cab0964cb5f4b0036bbaa719c1840 (diff) |
Segfaulting when uzbl.behave.commands hash table already destroyed.
-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); |