Should clean up class fields in class/base_finalize
@sdroege
Submitted by Sebastian Dröge Link to original bug (#592974)
Description
Hi, currently the memory managment features of vala are not applied to class fields. These should be cleaned up in class/base_finalize.
Example:
public class Test : GLib.Object {
private class Foo foo = new Foo();
}
public class Foo : GLib.Object {
}
public void main() {
new Test ();
}
Here the foo instance should be cleaned up in class_finalize
. It might be a problem to detect where to clean up though, if fields are assigned
- from instance/class/virtual methods or static ctors they should be cleaned up in
base_finalize
of the corresponding class and - if they're set in static methods, class ctors or are directly initialized (above example) they should be cleaned up in the
class_finalize
of the corresponding class.
Version: 0.7.x
Edited by Rico Tzschichholz