After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616343 - Scope Call is not properly implemented
Scope Call is not properly implemented
Status: RESOLVED FIXED
Product: pygi
Classification: Deprecated
Component: general
0.5
Other Linux
: Normal normal
: 0.6
Assigned To: pygi-maint
pygi-maint
Depends on:
Blocks:
 
 
Reported: 2010-04-20 21:52 UTC by Zach Goldberg
Modified: 2010-04-23 14:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Refactor implementation of scope call to allow for multiple calls during lifetime of function invocation. (2.90 KB, patch)
2010-04-21 02:44 UTC, Zach Goldberg
committed Details | Review

Description Zach Goldberg 2010-04-20 21:52:20 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.
Comment 1 Zach Goldberg 2010-04-21 02:44:14 UTC
Created attachment 159222 [details] [review]
Refactor implementation of scope call to allow for multiple calls during lifetime of function invocation.
Comment 2 Tomeu Vizoso 2010-04-23 12:30:24 UTC
Review of attachment 159222 [details] [review]:

Looks great!
Comment 3 Tomeu Vizoso 2010-04-23 14:35:23 UTC
Attachment 159222 [details] pushed as d3b5fae - Refactor implementation of scope call to allow for multiple calls during lifetime of function invocation.