mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 22:17:39 +00:00
Stop thread properly and close utterance.
This commit is contained in:
parent
07bf3d32e4
commit
f05702d450
2 changed files with 7 additions and 3 deletions
|
@ -149,9 +149,9 @@ static const arg_t cont_args_def[] = {
|
|||
}
|
||||
|
||||
utt_started = NO;
|
||||
NSLog(@"Ready....");
|
||||
NSLog(@"Ready.... <%@, %d>", _listeningThread, [_listeningThread isCancelled]);
|
||||
|
||||
while([_listeningThread isCancelled] == NO)
|
||||
while([_listeningThread isCancelled] == NO && _listeningThread != nil)
|
||||
{
|
||||
if ((k = ad_read(ad, adbuf, 2048)) < 0)
|
||||
{
|
||||
|
@ -193,6 +193,9 @@ static const arg_t cont_args_def[] = {
|
|||
}
|
||||
[NSThread sleepForTimeInterval: 0.01];
|
||||
}
|
||||
|
||||
// Close everything...
|
||||
ps_end_utt(ps);
|
||||
ad_close(ad);
|
||||
}
|
||||
|
||||
|
@ -202,6 +205,7 @@ static const arg_t cont_args_def[] = {
|
|||
[[NSThread alloc] initWithTarget: self
|
||||
selector: @selector(recognize)
|
||||
object: nil];
|
||||
[_listeningThread setName: @"Speech Recognition Loop"];
|
||||
NSLog(@"Thread info for speech reconigtion server %@", _listeningThread);
|
||||
[_listeningThread start];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue