Note: this bug was found in 0.6.1 itch.io build.
From the screenshot it can be seen that crash happens after game has been running for 17 minutes.
Didn't get any more information than this.
Don't have a reliable way to reproduce.
Most likely can be encountered only in release builds because in debug builds this issue is hidden by differences in debug builds.
Possible causes based on comments to that godot engine issue:
Calling free() - we never do that in youtd2, all calls are queue_free()
dead instances in deferred calls - we barely have any deferred calls, only for Minimap and DevControls and DevControls is not used in release build
not removing before free - we have some calls to queue_free() without first removing child, will try to fix this
Commits which might fix this:
b0080792eef0983ce3d0bc7fd55d33f5f4f05276 added missing queue_free() when item is consumed
40d7d61f9c33c84d2f2925daeba4c7df47cbccd8 added missing queue_free() after remove_child() for more cases. Also removed weird queue_free() call in UnitButtonContainer._process().
97311655fb53485893b7c088ae9a68c6309ec961 switched from connecting to tree_exiting() to tree_exited(). One effect of this change is that handlers for buff cleanup events now fire after unit/caster/handler has exited the tree. Before they were firing during the process of exiting.
Screenshot:
Note: this bug was found in 0.6.1 itch.io build. From the screenshot it can be seen that crash happens after game has been running for 17 minutes. Didn't get any more information than this. Don't have a reliable way to reproduce. Most likely can be encountered only in release builds because in debug builds this issue is hidden by differences in debug builds.
Link to related issue for godot engine: https://github.com/godotengine/godot/issues/70910
Possible causes based on comments to that godot engine issue:
Commits which might fix this: