Skip to content

Node:clipping -> Clipping to RenderTexture crash #8076

@minggo

Description

@minggo

Step to reproduce the issue:

  • run test-cpp
  • enter Node:clipping -> Clipping To RenderTexture
  • will crash sometimes on iOS and will 100% crash on Android

The problem is in this code

auto button = MenuItemFont::create("Reproduce bug", [&](Ref *sender) {
        enumerateChildren("remove me [0-9]", [&](Node *node) {
            this->removeChild(node);
            this->reproduceBug();
            return false;
        }
                          );
    });

Invoke removeChild() and addChild()(invoked in reproduceBug()) in the callback of enumerateChildren(). Because enumerateChildren() will iterate children, so it is not safe to remove or add a child.

@ricardoquesada
I found you added the test case, and i don't know why you do it like this.
Any idea?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions