loop: prevent stopping a stopped loop
This commit is contained in:
parent
b68864c3ba
commit
49ed160268
1 changed files with 2 additions and 0 deletions
|
@ -50,6 +50,8 @@ pub fn Loop(comptime T: type) type {
|
|||
|
||||
/// stops reading from the tty.
|
||||
pub fn stop(self: *Self) void {
|
||||
// If we don't have a thread, we have nothing to stop
|
||||
if (self.thread == null) return;
|
||||
self.should_quit = true;
|
||||
// trigger a read
|
||||
self.vaxis.deviceStatusReport(self.tty.anyWriter()) catch {};
|
||||
|
|
Loading…
Reference in a new issue