Closed tethal closed 8 years ago
also now that #38 has been fixed, this case also results in a memory leak that must be fixed here as well:
class A {
public {
any f = sub() {
return self;
};
}
destructor() {
print("destroyed\n");
}
}
A a();
the issue with closures is a separate leak that will require enhancements to the deterministic GC algorithm and has been opened as #73
Code:
Expected output:
Actual output:
Valgrind:
Notes:
Creating the circular reference after the object is created works as expected:
Also, creating it in the constructor works as well:
There might be a connection to issue #38.