about summary refs log tree commit diff stats
path: root/xombrero.c
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-08-20 19:22:45 -0400
committerJosh Rickmar <jrick@devio.us>2012-08-20 19:22:45 -0400
commitecc38e92afec8eb237a1cdd20661a932c6c27679 (patch)
treeb3eaf3aee1b2053bf97a1531e5644589919c7a88 /xombrero.c
parent3afd7f4e2bdcb1651e9ab55fd2ae37271c14dfe5 (diff)
downloadxombrero-ecc38e92afec8eb237a1cdd20661a932c6c27679.tar.gz
ref/unref t->active before it is set or unset
This should fix any crashes when determining if t->active is an active
input element or not.  The pointer is from a function which returns
transfer none, so if we want to keep it alive (we do), we need
manually add reference to it, and unrefernce it so it is freed.
Diffstat (limited to 'xombrero.c')
-rw-r--r--xombrero.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xombrero.c b/xombrero.c
index 172b3ee..567fc6f 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -4308,6 +4308,8 @@ notify_load_status_cb(WebKitWebView* wview, GParamSpec* pspec, struct tab *t)
 
 		/* DOM is changing, unreference the previous focused element */
 #if WEBKIT_CHECK_VERSION(1, 5, 0)
+		if (t->active)
+			g_object_unref(t->active);
 		t->active = NULL;
 		if (t->active_text) {
 			g_free(t->active_text);