This question is more of a sanity check than anything else, but I just wanted to check whether if I were to do this with a nested class:
class Nested:
var x: int
func _init(nx: int):
x = nx
func make_nested() -> Nested:
return Nested.new(2)
...would the returned Nested
need to be free()
'd, just as with any other un-memory-managed Object
?
If not, I'm guessing that it'd be wise for me to add extends Reference
to the nested class to prevent leaks. Is this a pattern anyone else has used?