summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-11-18 18:53:46 +0100
committerportix <none@none>2012-11-18 18:53:46 +0100
commitf126e00cd9d055dc445cbd1ccda552d62c947703 (patch)
tree83f41608aa1c588b23e6bb4a21fee045037a98a0 /src
parentaed534065ca59cda04b615cbfe26df40669ceefa (diff)
downloaddwb-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.c1
-rw-r--r--src/dwb.h1
-rw-r--r--src/view.c5
3 files changed, 5 insertions, 2 deletions
diff --git a/src/dwb.c b/src/dwb.c
index 01d36354..f94f6dc3 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -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;
}
diff --git a/src/dwb.h b/src/dwb.h
index b73dc2b2..c89dbfd1 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -665,6 +665,7 @@ struct _View {
GtkWidget *inspector_window;
ViewStatus *status;
Plugins *plugins;
+ WebKitWebSettings *settings;
struct {
WebKitDOMElement *element;
WebKitDOMElement *anchor;
diff --git a/src/view.c b/src/view.c
index 6b6ea1dd..fce39553 100644
--- a/src/view.c
+++ b/src/view.c
@@ -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);