When are objects freed through auto_free #146
-
When you queue an object for being automatically freed using the class Test
extends GdUnitTestSuite
var some_shared_Node:Node
var some_per_test_node:Node
func before():
some_shared_node = auto_free(Foo.new())
func before_test():
some_per_test_node = auto_free(Bar.new())
Now question is, when will |
Beta Was this translation helpful? Give feedback.
Answered by
MikeSchulze
Sep 10, 2021
Replies: 1 comment 3 replies
-
Hi derkork, Scopes are:
If this anwsers your question? |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
derkork
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi derkork,
Objects covered by
auto_free
live only in the scope where it is used.Scopes are:
before()
and ends withafter()
after()
is called the memory fill be auto freed.before_test()
and ends withafter_test()
after_test()
is called the memory fill be auto freed.test()
is called the memory fill be auto freed.If this anwsers your question?
I will next improve the documentation to add the missing info.