2008-05-25 Jürg Billeter <j@bitron.ch>
+ * gobject/valaccodeclassbinding.vala:
+
+ Support destructors for non-GObject classes,
+ patch by Jared Moore, fixes bug 522135
+
+ * tests/classes.exp:
+ * tests/classes.vala:
+
+ Test destructors for non-GObject classes
+
+2008-05-25 Jürg Billeter <j@bitron.ch>
+
* vala/valacodenode.vala:
* vala/valacreationmethod.vala:
* vala/valaexpression.vala:
cblock.add_statement (codegen.instance_dispose_fragment);
+ if (cl.destructor != null) {
+ cblock.add_statement (cl.destructor.body.ccodenode);
+ }
+
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_slice_free"));
ccall.add_argument (new CCodeIdentifier (cl.get_cname ()));
ccall.add_argument (new CCodeIdentifier ("self"));
ClassWithCreationMethod
new ClassWithNamedCreationMethod ()
ClassWithNamedCreationMethod
+new ClassWithDestructor ()
+~ClassWithDestructor
new SimpleGTypeInstanceClass ()
new DerivedGTypeInstanceClass ()
new PublicGTypeInstanceClass ()
public int field;
}
+class ClassWithDestructor {
+ ~ClassWithDestructor () {
+ stdout.printf ("~ClassWithDestructor\n");
+ }
+
+ /* FIXME bug 533977 */
+ public char dummy;
+}
+
class DerivedClass : SimpleClass {
}
var class_with_creation_method = new ClassWithCreationMethod ();
stdout.printf ("new ClassWithNamedCreationMethod ()\n");
var class_with_named_creation_method = new ClassWithNamedCreationMethod.named ();
+ stdout.printf ("new ClassWithDestructor ()\n");
+ var class_with_destructor = new ClassWithDestructor ();
+ class_with_destructor = null;
stdout.printf ("new SimpleGTypeInstanceClass ()\n");
var simple_gtypeinstance_class = new SimpleGTypeInstanceClass ();