Skip to content

Commit 487faf9

Browse files
committed
Allow History Manager writer thread to exit when queue is empty
1 parent 82c43c3 commit 487faf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/rex/ui/text/shell/history_manager.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ def switch_context(new_context, old_context=nil)
200200
def write_history_file(history_file, cmds)
201201
write_queue_ref = @write_queue
202202
remaining_work_ref = @remaining_work
203+
203204
@write_thread ||= Rex::ThreadFactory.spawn("HistoryManagerWriter", false) do
204-
while (event = write_queue_ref.pop)
205+
while (write_queue_ref.size > 0 && event = write_queue_ref.pop)
205206
begin
206207
history_file = event[:history_file]
207208
cmds = event[:cmds]

0 commit comments

Comments
 (0)