Reply To: NodeCanvas consistent memory leaks

NodeCanvas Forums Support NodeCanvas consistent memory leaks Reply To: NodeCanvas consistent memory leaks


Update: I have tried modifying all Node classes in order to return their preferred size (e.g. calculating their height based on the text’s lines count), and I used this info to manually draw a flexible Node window (with GUI.Box(calculatedWindowRect, …) as the background, instead of GUILayout.Window). The memory issue seemed to stop, but the nodes weren’t always drawn correctly and I sadly can’t achieve more than this now.

Since this solution is not doable for me, I have tried another workaround:
– I have kept using GUILayout.Window, but I removed the GUILayoutOptions (the window seems to resize anyways).
– replaced string.Empty with GUIContent.none
– Other than that, the “DrawNodeWindow” method is not static anymore (including all functions invoked inside it) and accepts the windowID as parameter, so it can be passed to the GUILayout.Window directly instead of () => {….}.
It becomes: GUILayout.Window(node.ID, node.Rect, node.NodeWindowGUI, GUIContent.none, StyleSheet.window);

With this last workaround, the memory increase/leak still happens, but it seems to be lower and slower than before.
Please let us know if you can help us, since I am still unsure if I can use the asset in my project or if I should opt for something else because of it. Thanks!