I found conditions when you may easy getting issue of full buffer.
having GUI with template node.
clone this node in on_message() by sending message “PleaseClone” to this GUI script.
delete cloned nodes in the same on_message() function.
send message “PleaseClone” many times to this GUI. For example into update of other script for quick result.
all work correct. You clone/delete nodes.
disable this GUI component.
Congratulation. “ERROR:GUI: Could not create the node since the buffer is full (512).” in console.
So, I’ve made small demo project, here: https://www.dropbox.com/s/emkbfomlsm0vaht/guinodetest.zip?dl=0
to reproduce the error please uncomment line
msg.post("/inv#inventory", "disable")
in init() of main.script.
2 Likes
dmitriy
December 22, 2018, 5:38pm
2
Probably expected behavior. Nodes gets not deleted, but somehow “marked for deletion” and deleted in “post-update” phase.
function init(self)
for i = 1, 513 do
local node = gui.new_box_node(vmath.vector3(), vmath.vector3())
gui.delete_node(node)
end
end
This code in empty gui component is enough to get the same message.
britzl
December 22, 2018, 9:35pm
3
Yes, that is the expected behavior. Nodes and game objects for that matter exist the entirety of a frame and count towards the node/instance cap.
AGulev
December 22, 2018, 9:43pm
4
But your example is absolutely different.
Yes, you have the same message but using expected behavior.
In the example by @Dragosha you can create and remove one node per frame, and still receive an error after 512 frames. Looks like nodes haven’t deleted after disabling of gui component ( “post-update” doesn’t called on the disabled component)
dmitriy
December 22, 2018, 10:07pm
5
It is just simulation of what happened in @Dragosha code. Disabled gui don’t receive update callback, so no post-update for them either.
1 Like
AGulev
December 22, 2018, 10:18pm
6
Ok, now I understand what do you mean.
More information about loop (including post_update) here
1 Like
britzl
December 22, 2018, 10:28pm
7
Oh, yes, that would be totally different and definitely a bug.
2 Likes