[SOLVED] NodePool BUG (CC 2.4.11)?

Found a problem with NodePool (CC 2.4.11), is not able to return back all nodes from ‘container’ node.
There is a demo below,

  1. Fill the list
  2. Press Recycle.
  3. Some items still there.

BUGPOOL.zip (910.1 KB)

solved, well according event loop there is might be a delay with removing node , so solution is add delay before remove each node.

        this.scrollView.content.children.forEach( node => {
            this.scheduleOnce( () => {
                this._nodePool.put(node);
            }, cc.director.getDeltaTime())
        });
2 Likes