diff options
author | portix <none@none> | 2012-10-10 20:25:33 +0200 |
---|---|---|
committer | portix <none@none> | 2012-10-10 20:25:33 +0200 |
commit | 57394119793abec65946499c879ec59be0fed733 (patch) | |
tree | a40a0623252cf6f058a43eebe369683ec465c927 /src | |
parent | 9ad2bb01e71628f34dbb6a133a762dd5d99553b5 (diff) | |
download | dwb-57394119793abec65946499c879ec59be0fed733.zip |
Protect callback function in global_send_request
Diffstat (limited to 'src')
-rw-r--r-- | src/scripts.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/scripts.c b/src/scripts.c index 593961c6..dce035f7 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -836,6 +836,7 @@ request_callback(SoupSession *session, SoupMessage *message, JSObjectRef functio JSObjectRef o = get_message_data(message); JSValueRef vals[] = { o, make_object(m_global_context, G_OBJECT(message)) }; JSObjectCallAsFunction(m_global_context, function, NULL, 2, vals, NULL); + JSValueUnprotect(m_global_context, function); } } static JSValueRef @@ -857,6 +858,7 @@ global_send_request(JSContextRef ctx, JSObjectRef f, JSObjectRef thisObject, siz SoupMessage *msg = soup_message_new(method == NULL ? "GET" : method, uri); if (msg == NULL) goto error_out; + JSValueProtect(ctx, function); soup_session_queue_message(webkit_get_default_session(), msg, (SoupSessionCallback)request_callback, function); ret = 0; error_out: |