From 03d7471656725386b139b9839092cecabea1caac Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Wed, 15 May 2024 00:01:00 +0200 Subject: [PATCH] fix: remove superfluous import and global var Signed-off-by: Christopher Arndt --- examples/jacket_midi_print_threading.nim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/jacket_midi_print_threading.nim b/examples/jacket_midi_print_threading.nim index 0b63b09..2d3350a 100644 --- a/examples/jacket_midi_print_threading.nim +++ b/examples/jacket_midi_print_threading.nim @@ -4,14 +4,13 @@ # nimble install threading # -import std/[isolation, logging, os, strformat] +import std/[logging, os, strformat] import threading/channels import signal import jacket var jclient: ClientP - event: MidiEvent midiPort: PortP midiEventChan: Chan[MidiEvent] midiEventPrinter: Thread[void] @@ -32,8 +31,8 @@ proc cleanup() = debug "Stopping MIDI event printer thread..." # Receiving an invalid event causes receiving thread to wake up and # break its endless loop - event.size = 0 - midiEventChan.send(event) + let event = MidiEvent(size: 0) + discard midiEventChan.trySend(event) midiEventPrinter.joinThread()