oniksan / godobuf

A Google Protobuf implementation for Godot / GDScript
BSD 3-Clause "New" or "Revised" License
248 stars 34 forks source link

Generated classes should extend Reference #10

Closed wooky closed 1 year ago

wooky commented 3 years ago

Currently, the generated classes extend Object, so when they're no longer used, they need to be deallocated manually or else they will leak (see here). I propose that they should extend Reference so when they're no longer used, they get deallocated automatically.

oniksan commented 3 years ago

Ok. I'll see when I have free time. I'll write here if I do something or do not do.

Birdulon commented 2 years ago

For anyone seeing this now and concerned about manually freeing their message objects, in Godot 3.5 the default inheritance (which all the generated classes fall back to) is Reference. ( https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html#memory-management ) In my testing, this seems to also be the case in 3.4.4-stable, but I can't find documentation to back this behaviour up and haven't tested any earlier Godot versions against this.

oniksan commented 2 years ago

@wooky, where did you see that generated classes extend Object?

oniksan commented 1 year ago

I close this issue, because it's not relevant.