Skip to content

Commit

Permalink
Merge pull request #26 from gilzoide/bugfix/parent-memory-leak
Browse files Browse the repository at this point in the history
Use WeakRef in layout node parent to avoid cyclic strong references
  • Loading branch information
gilzoide authored Nov 13, 2023
2 parents c5d25d8 + fbe2fec commit 63943c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addons/dockable_container/layout_node.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ class_name DockableLayoutNode
extends Resource
## Base class for DockableLayout tree nodes

var parent: DockableLayoutSplit = null
var parent: DockableLayoutSplit:
get:
return _parent_ref.get_ref()
set(value):
_parent_ref = weakref(value)

var _parent_ref := WeakRef.new()


func emit_tree_changed() -> void:
Expand Down

0 comments on commit 63943c3

Please sign in to comment.