Giter Club home page Giter Club logo

Comments (6)

hugohuang1111 avatar hugohuang1111 commented on September 27, 2024

@chenquanjun
我用你的代码,在3.3final上尝试,没有出现,
你的是必现吗?确定是在3.3final上?

from v3quick.

chenquanjun avatar chenquanjun commented on September 27, 2024

我新建了一个,还是会崩溃 @htlxyz
qq 20150121165517

from v3quick.

chenquanjun avatar chenquanjun commented on September 27, 2024

0x0104F441 处的第一机会异常(在 Quick3d.exe 中): 0xC0000005: 读取位置 0xFEEEFEF2 时发生访问冲突。
0x0104F441 处有未经处理的异常(在 Quick3d.exe 中): 0xC0000005: 读取位置 0xFEEEFEF2 时发生访问冲突。

qq 20150121170412

堆栈
qq 20150121170310

from v3quick.

chenquanjun avatar chenquanjun commented on September 27, 2024

看了一下代码,触发崩溃的条件是整个场景中只有一个触摸对象。

这里只有一个按钮,在点击回调里面设置按钮不可触摸,最后会调用destroyInstance方法。

void LuaTouchEventManager::onTouchesEnded(const std::vector<Touch*>& touches, Event *event)
{
    for (auto it = touches.begin(); it != touches.end(); ++it)
    {
        m_touchingIds.erase(((Touch*)*it)->getID());
    }

    if (m_touchingIds.size())
    {
        dispatchingTouchEvent(touches, event, CCTOUCHREMOVED);
    }
    else
    {
        dispatchingTouchEvent(touches, event, CCTOUCHENDED); //执行完毕后Instance已经被析构
        // remove all touching nodes
        //CCLOG("TOUCH ENDED, REMOVE ALL TOUCH TARGETS");
        _touchingTargets.clear();  //_touchingTargets已经被析构,再调用clear会出错
    }
}

void LuaTouchEventManager::removeTouchableNode(LuaEventNode *node)
{
    //...省略代码...
    if (_touchableNodes.size() == 0 && m_touchDispatchingEnabled) //因为只有一个按钮而且按钮已经被禁用触摸
    {
        disableTouchDispatching();
        destroyInstance(); //执行此代码
    }
}

from v3quick.

SunLightJuly avatar SunLightJuly commented on September 27, 2024

已修复。谢谢反馈!

from v3quick.

kawaiSky avatar kawaiSky commented on September 27, 2024

貌似 这里还是会有问题

if (touchMode == LuaEventNode::modeTouchesAllAtOnce)
 {
       node->ccTouchesBegan(touches, event);
 }
 else
  {
       ret = node->ccTouchBegan(touchTarget->findTouch(touches), event);
   }

if (ret)
 {
       _touchingTargets.pushBack(touchTarget);
       //CCLOG("ADD TOUCH TARGET [%p]", touchTarget->getNode()->getNode());
 }

在ccTouchBegan中执行了setEnabeld(false)了之后,就导致整个对象被delete了。那个_touchingTargets其实就已经是被释放了的,应该会出问题的

from v3quick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.