Open bread2012 opened 10 months ago
确实存在你说的这个问题,不过后面的提交中,我将反注册agent的逻辑修改为: deregister的时候,就将它从AgentManager中的移除了,这样在handlevent时,由于找不到agent,也就取不到waiting_nodes指针,就不会发生你上面所说的第一次析构的过程
确实存在你说的这个问题,不过后面的提交中,我将反注册agent的逻辑修改为: deregister的时候,就将它从AgentManager中的移除了,这样在handlevent时,由于找不到agent,也就取不到waiting_nodes指针,就不会发生你上面所说的第一次析构的过程
你们项目也是在用这个库吗?
我就是作者,昨天忘了换马甲了。有项目接入了,但还没有大规模使用,而且编辑器那边最近也在调整,所以目前来说项目还处于比较alpha的阶段
再问下,再asyncflow::lua::event函数内,有把参数存到LUA_REGISTRYINDEX table的操作,event_args[i] = luaL_ref(L, LUA_REGISTRYINDEX)。但是没有看到luaL_unref的操作呢,在delete event的时候只有helper.DecRef的操作,但是lua_manager.h的DecRef函数并没有做任何操作,有内存泄漏的风险呢
确实,当时忘了。你是在lua里面使用吗?我现在的改动都是在python的基础上在测试,lua那边的测试case都还没有准备。核心那部分应该都OK,但是导出接口这块可能没来得及更新。
对,我是在lua里使用的
NodeWaitAll:Run函数里 reset的时应该是iter->second=false吧?另外NodeWaitAll:Stop的时候也应该reset一次状态?
NodeWaitAll:Run函数里 reset的时应该是iter->second=false吧?另外NodeWaitAll:Stop的时候也应该reset一次状态?
你说得对,我马上改一下
已提交
void Manager::HandleEvent(AsyncEventBase& ev) { auto* agent = ev.GetAgent(); auto* waiting_nodes = agent->GetWaitNodes(ev.Id()); if (waiting_nodes == nullptr || waiting_nodes->IsEmpty()) return; current_event_ = &ev; waiting_nodes_ = waiting_nodes; agent->HandleEvent(ev, waiting_nodes); delete waiting_nodes; waiting_nodes_ = nullptr; current_event_ = nullptr; }
当Agent处于Destroying状态时: