diff options
author | portix <none@none> | 2012-11-18 18:53:46 +0100 |
---|---|---|
committer | portix <none@none> | 2012-11-18 18:53:46 +0100 |
commit | f126e00cd9d055dc445cbd1ccda552d62c947703 (patch) | |
tree | 83f41608aa1c588b23e6bb4a21fee045037a98a0 /src | |
parent | aed534065ca59cda04b615cbfe26df40669ceefa (diff) | |
download | dwb-f126e00cd9d055dc445cbd1ccda552d62c947703.zip |
Free websettings when destroying a tab; fixing memory leak in dwb_get_scripts if script is a symlink
Diffstat (limited to 'src')
-rw-r--r-- | src/dwb.c | 1 | ||||
-rw-r--r-- | src/dwb.h | 1 | ||||
-rw-r--r-- | src/view.c | 5 |
3 files changed, 5 insertions, 2 deletions
@@ -2882,6 +2882,7 @@ dwb_get_scripts() { else if (g_file_test(path, G_FILE_TEST_IS_SYMLINK)) { realpath = g_file_read_link(path, &error); if (realpath != NULL) { + g_free(path); fprintf(stderr, "Cannot read %s : %s\n", path, error->message); goto loop_end; } @@ -665,6 +665,7 @@ struct _View { GtkWidget *inspector_window; ViewStatus *status; Plugins *plugins; + WebKitWebSettings *settings; struct { WebKitDOMElement *element; WebKitDOMElement *anchor; @@ -843,7 +843,8 @@ view_set_normal_style(GList *gl) { static void view_init_settings(GList *gl) { View *v = gl->data; - webkit_web_view_set_settings(WEBKIT_WEB_VIEW(v->web), webkit_web_settings_copy(dwb.state.web_settings)); + v->settings = webkit_web_settings_copy(dwb.state.web_settings); + webkit_web_view_set_settings(WEBKIT_WEB_VIEW(v->web), v->settings); GList *l; for (l = g_hash_table_get_values(dwb.settings); l; l=l->next) { WebSettings *s = l->data; @@ -1057,7 +1058,7 @@ view_clean(GList *gl) { g_object_unref(v->hover.element); g_object_unref(v->status_element); - + g_object_unref(v->settings); /* Destroy widget */ gtk_widget_destroy(v->web); gtk_widget_destroy(v->scroll); |