Fix serial close behavior
This commit is contained in:
parent
8073e3d39e
commit
641f26e13e
@ -453,7 +453,6 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
|
|||||||
- (void) run
|
- (void) run
|
||||||
{
|
{
|
||||||
assert(!master);
|
assert(!master);
|
||||||
running = true;
|
|
||||||
[self preRun];
|
[self preRun];
|
||||||
if (slave) {
|
if (slave) {
|
||||||
[slave preRun];
|
[slave preRun];
|
||||||
@ -532,6 +531,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (running) return;
|
if (running) return;
|
||||||
|
running = true;
|
||||||
[[[NSThread alloc] initWithTarget:self selector:@selector(run) object:nil] start];
|
[[[NSThread alloc] initWithTarget:self selector:@selector(run) object:nil] start];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2065,6 +2065,7 @@ static unsigned *multiplication_table_for_frequency(unsigned frequency)
|
|||||||
bool wasRunning = self->running;
|
bool wasRunning = self->running;
|
||||||
Document *partner = master ?: slave;
|
Document *partner = master ?: slave;
|
||||||
if (partner) {
|
if (partner) {
|
||||||
|
wasRunning |= partner->running;
|
||||||
[self stop];
|
[self stop];
|
||||||
partner->master = nil;
|
partner->master = nil;
|
||||||
partner->slave = nil;
|
partner->slave = nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user