Instruction. How to get "ERROR:GUI: Could not create the node since the buffer is full (512)."


#1

I found conditions when you may easy getting issue of full buffer.

  1. having GUI with template node.
  2. clone this node in on_message() by sending message “PleaseClone” to this GUI script.
  3. delete cloned nodes in the same on_message() function.
  4. send message “PleaseClone” many times to this GUI. For example into update of other script for quick result.
  5. all work correct. You clone/delete nodes.

  1. disable this GUI component.
  2. 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

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.


#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.


#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)


#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.


#6

Ok, now I understand what do you mean.
More information about loop (including post_update) here


#7

Oh, yes, that would be totally different and definitely a bug.