Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua引擎 又一个新的崩溃bug #200

Open
w4454962 opened this issue Jul 11, 2020 · 0 comments
Open

lua引擎 又一个新的崩溃bug #200

w4454962 opened this issue Jul 11, 2020 · 0 comments

Comments

@w4454962
Copy link

w4454962 commented Jul 11, 2020

代码如下 测试版本 ydwe1.32.13 疯狂按esc即可闪退

local console = require 'jass.console'
local runtime = require 'jass.runtime'
local jass = require 'jass.common'
console.enable = true 
print = console.write 


function test()
    local trg = jass.CreateTrigger()
    jass.TriggerRegisterPlayerEvent(trg, jass.Player(0), jass.EVENT_PLAYER_END_CINEMATIC)
    jass.TriggerAddAction(trg, function ()
        print("ESC", coroutine.running())
    end)
end 

local co = coroutine.create(test)
coroutine.resume(co)

runtime.sleep = true

大概 runtime.sleep 无论什么情况下都要置顶 否则会发生崩溃 提交到这里警示一下其他人注意一下吧

崩溃的原因是 触发器所在的子线程被回收 之后再次回调时是野指针产生的崩溃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant