From ddd4baa002e8764e4ebf2a6bef586b3d1a69707c Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 26 Feb 2016 20:36:35 +0100 Subject: [PATCH] small bugfix --- scan.lua | 13 +++++++++---- search_frame.lua | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scan.lua b/scan.lua index b5c3d18..0da88c8 100644 --- a/scan.lua +++ b/scan.lua @@ -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 diff --git a/search_frame.lua b/search_frame.lua index b9613ab..a95c85b 100644 --- a/search_frame.lua +++ b/search_frame.lua @@ -896,6 +896,7 @@ do return end + state = SEARCHING Aux.scan_util.find( record, private.status_bar, @@ -949,7 +950,6 @@ do if not selection then state = IDLE elseif selection and state == IDLE then - state = SEARCHING private.find_auction(selection.record) elseif state == FOUND and not private.test(selection.record)(found_index) then private.buyout_button:Disable()