GNOME Bugzilla – Bug 617571
Reference count bug in signals
Last modified: 2010-06-07 19:01:46 UTC
Created attachment 160224 [details] valac fail.vala --pkg gtk+-2.0 --pkg posix When using '+=' instead of '.connect()' on signals, closures are failing because the passed struct is freed just after attaching the callback. Attached is a sample code to reproduce the issue.
+= is deprecated, latest patches have been written to work with .connect() rather than with +=, you shouldn't be using it.
If its deprecated and buggy, Vala should WARN with a "deprecated" message or just, give an error. It's a pity to fall in bugs because you are using something deprecated but nobody warns or bans you to do it. I would prefer not to allow += anymore in next release.
Created attachment 162496 [details] [review] deprecate obj.signal += callback
commit c353329b280f945d6d8188af5817ae44723d6e1d Author: Luca Bruno <lethalman88@gmail.com> Date: Tue Jun 1 22:06:17 2010 +0200 Deprecate use of += and -= for signals The connect/disconnect methods should be used instead. Fixes bug 617571.