quick3.5 removefromparent () causes a crash problem with Windows emulator

Source: Internet
Author: User

Today, there is a problem, click on a button, the layer where the button is removed from scene:

1        LocalClick =function(Event)2          LocalStartscene=require("App/scenes/startscene")3             LocalTag =Event.target:getTag ()4             ifTag = =1  Then5 cc. Director:getinstance (): Endtolua ()6                 ElseIfTag = =2  Then7 self:removefromparent ()8             End9        End

The code is running on Mac, and it's not a problem, the same code that runs on the Windows7 machine has collapsed, the simulator window and the Debug window are stuck. Later the problem code to focus on the self:removefromparent (), on-line search, said the use of delayed deletion, can prevent crashes, so the code self:removefromparent () changed to:

             local delay=cc. Delaytime:create (0.1)             local callf=cc. Callfunc:create (function  (...)                  Self:removefromparent ()             end)              self:runaction (CC. Sequence:create (DELAY,CALLF,nil))

No longer crashes.

quick3.5 removefromparent () causes a crash problem with Windows emulator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.