Ok i think i get it, as long as the nodes point to the objects stored in the queue, but not the other way around.
Also i should have mentioned it, but im here assuming i use a byte Ptr as a value pointer in my nodes to let them be able to take whatever i want to store in the queue.
So to clarify your answer, by nullifying my first and last pointers in the Queue class, the garbagecollector will collect all nodes that was in the Queue and anything that the nodes was pointing to. Assuming nothing else is pointing to the objects or nodes, and assuming the objects in the nodes doesnt point back to the queue in any way.
Also i should have mentioned it, but im here assuming i use a byte Ptr as a value pointer in my nodes to let them be able to take whatever i want to store in the queue.
So to clarify your answer, by nullifying my first and last pointers in the Queue class, the garbagecollector will collect all nodes that was in the Queue and anything that the nodes was pointing to. Assuming nothing else is pointing to the objects or nodes, and assuming the objects in the nodes doesnt point back to the queue in any way.