GNOME Bugzilla – Bug 659619
Allow copyable delegates
Last modified: 2014-06-29 08:55:18 UTC
Copyable delegates correspond to 4 elements instead of 3 (as normal delegates), 2 (unowned delegates) or 1 (delegates without target): - delegate itself - target - target copy - target destroy In this way the delegate can be safely shared. The lambda blocks can be reference counted for such delegates.
This will never be the case, just wrap it in a class or use GClosure (which needs some work). The fact that we current use delegate+target+destroy is an unfortunate implementation due to mapping to existing C libraries.
(In reply to comment #1) > This will never be the case, just wrap it in a class or use GClosure (which > needs some work). The fact that we current use delegate+target+destroy is an > unfortunate implementation due to mapping to existing C libraries. Is there any documentation regarding using GClosure and vala?
(In reply to comment #2) > (In reply to comment #1) > > This will never be the case, just wrap it in a class or use GClosure (which > > needs some work). The fact that we current use delegate+target+destroy is an > > unfortunate implementation due to mapping to existing C libraries. > > Is there any documentation regarding using GClosure and vala? Ups. Missing "(unless you mean direct interface to C)".
*** Bug 680931 has been marked as a duplicate of this bug. ***
Marking for 0.10. Proposed syntaxt: [Closure] public delegate void Closure(void); Closure c = ...
The GClosure thing must be per-parameter, not per-delegate.
Duplicate of bug #632853?
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 632853 ***