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 695050 - Compact classes can silently leak memory
Compact classes can silently leak memory
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Generics
unspecified
Other All
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-03 11:44 UTC by Maciej (Matthew) Piechotka
Modified: 2018-05-22 14:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Maciej (Matthew) Piechotka 2013-03-03 11:44:38 UTC
Consider following case:

[Compact]
class LeakMemory<G> {
    G g;
}

LeakMemory<Gtk.Widget>? lm = new LeakMemory<Gtk.Widget>();
lm.g = new Gtk.Window();
lm = null; // lm.g memory is freed, right?

Proposed solution:

 - Add warning for old-style generics that contains generic fields
 - Add attribute [GenericDtor] or similar (possibly [GenericMethods] as well) which allows to pass the generic attributes via arguments rather then store in class.
Comment 1 GNOME Infrastructure Team 2018-05-22 14:42:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/360.