mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 16:10:48 +00:00
Use a thread to start listening and release it when done.
This commit is contained in:
parent
1c792c3f40
commit
e50bfcf35d
1 changed files with 7 additions and 3 deletions
|
@ -174,13 +174,17 @@ static const arg_t cont_args_def[] = {
|
|||
|
||||
- (void) startListening
|
||||
{
|
||||
[NSThread detachNewThreadSelector: @selector(recognize)
|
||||
toTarget: self
|
||||
withObject: nil];
|
||||
_listeningThread = [[NSThread alloc] initWithTarget: self
|
||||
selector: @selector(recognize)
|
||||
object: nil];
|
||||
[_listeningThread start];
|
||||
}
|
||||
|
||||
- (void) stopListening
|
||||
{
|
||||
[_listeningThread cancel];
|
||||
RELEASE(_listeningThread);
|
||||
_listeningThread = nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue