blob: d5de16b62b8ba349e0a805b6d5a0cc3ed6d56f6d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
class Foo : Object {
[DestroysInstance]
public void free () {
assert (this.ref_count == 2);
this.unref ();
}
}
void main () {
var foo = new Foo ();
{
foo.free ();
}
assert (foo.ref_count == 1);
}
|