GNOME Bugzilla – Bug 616343
Scope Call is not properly implemented
Last modified: 2010-04-23 14:35:26 UTC
Two major issues with the current implementation 1) If the function finishes without calling the callback we leak the closure. 2) During the function invocation if it calls the callback twice we crash on the second time because we've free'd the closure before the call ended (not proper behavior). The closure should only be free'd after the function finishes (and always when the function finishes). Proposed Fix: I think, instead of free'ing the scope call callback inside pygi_handle_clsoure we should check for the scope type inside invoke() and free it also inside invoke after the function invokation.
Created attachment 159222 [details] [review] Refactor implementation of scope call to allow for multiple calls during lifetime of function invocation.
Review of attachment 159222 [details] [review]: Looks great!
Attachment 159222 [details] pushed as d3b5fae - Refactor implementation of scope call to allow for multiple calls during lifetime of function invocation.