From: Charlie Brej Date: Fri, 2 Apr 2010 16:24:07 +0000 (+0100) Subject: [script] Reference this if function is called with current object as this X-Git-Tag: 0.8.2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=417beaca9b0d64a1e91e9e721dff8c86ce5af8eb;p=thirdparty%2Fplymouth.git [script] Reference this if function is called with current object as this If calling a function which is connected to the current object, the object operated on in the function call is the current object. This is rarely used and somehow survived without causing crashes despite incorrectly not increasing the refcount. --- diff --git a/src/plugins/splash/script/script-execute.c b/src/plugins/splash/script/script-execute.c index 702f8f7a..6abd3a68 100644 --- a/src/plugins/splash/script/script-execute.c +++ b/src/plugins/splash/script/script-execute.c @@ -324,7 +324,10 @@ static script_obj_t *script_evaluate_func (script_state_t *state, { func_obj = script_obj_hash_peek_element (state->this, name); if (func_obj) - this_obj = state->this; + { + this_obj = state->this; + script_obj_ref(this_obj); + } else { func_obj = script_obj_hash_peek_element (state->global, name);