small bugfix

This commit is contained in:
Manuel Simon Hirsig
2016-02-26 20:36:35 +01:00
parent 346c7f5b88
commit ddd4baa002
2 changed files with 10 additions and 5 deletions
+9 -4
View File
@@ -36,13 +36,18 @@ function public.start(params)
end
function public.abort(type)
local aborted_threads = {}
for t, thread in pairs(threads) do
if not type or type == t then
if thread.params.on_abort then
thread.params.on_abort()
end
threads[t] = nil
Aux.control.kill_thread(thread.id)
threads[t] = nil
tinsert(aborted_threads, thread)
end
end
for _, thread in ipairs(aborted_threads) do
if thread.params.on_abort then
thread.params.on_abort()
end
end
end