Tons of bugfixes (lots with closures). Added safe_recursive_delete to mem which helps easily and safely delete recursive data structures, and used it in regex. It still has a leak, but it's a lot better than before.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import io:*
|
||||
import set
|
||||
import mem
|
||||
|
||||
fun runFunc(func: fun():void) {
|
||||
func()
|
||||
@@ -18,10 +20,23 @@ obj ToClose {
|
||||
}
|
||||
}
|
||||
|
||||
obj One (Object) {
|
||||
fun construct(): One* {
|
||||
return this
|
||||
}
|
||||
fun destruct() {
|
||||
var a:One
|
||||
mem::safe_recursive_delete(&a, fun(it: One*): set::set<One*> { return set::set(it); } )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun main():int {
|
||||
var it: ToClose
|
||||
it.testMethod()
|
||||
it.testVariable()
|
||||
//var a = 7
|
||||
//mem::safe_recursive_delete(&a, fun(it: int*): set::set<int*> { return set::set(it); } )
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user