mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-02-16 10:31:02 +00:00
Only dispatch_async on limelight-common's threads
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
-(id) initWithConfig:(StreamConfiguration*)config renderer:(VideoDecoderRenderer*)myRenderer connectionCallbacks:(id<ConnectionCallbacks>)callbacks;
|
||||
-(void) terminate;
|
||||
-(void) terminateInternal;
|
||||
-(void) main;
|
||||
|
||||
@end
|
||||
|
||||
@@ -275,7 +275,7 @@ void ClDisplayTransientMessage(char* message)
|
||||
[_callbacks displayTransientMessage: message];
|
||||
}
|
||||
|
||||
-(void) terminate
|
||||
-(void) terminateInternal
|
||||
{
|
||||
// We dispatch this async to get out because this can be invoked
|
||||
// on a thread inside common and we don't want to deadlock
|
||||
@@ -285,6 +285,13 @@ void ClDisplayTransientMessage(char* message)
|
||||
});
|
||||
}
|
||||
|
||||
-(void) terminate
|
||||
{
|
||||
// We're guaranteed to not be on a limelight-common thread
|
||||
// here so it's safe to call stop directly
|
||||
LiStopConnection();
|
||||
}
|
||||
|
||||
-(id) initWithConfig:(StreamConfiguration*)config renderer:(VideoDecoderRenderer*)myRenderer connectionCallbacks:(id<ConnectionCallbacks>)callbacks
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@@ -14,5 +14,6 @@
|
||||
|
||||
- (id) initWithConfig:(StreamConfiguration*)config renderView:(UIView*)view connectionCallbacks:(id<ConnectionCallbacks>)callback;
|
||||
- (void) stopStream;
|
||||
- (void) stopStreamInternal;
|
||||
|
||||
@end
|
||||
|
||||
@@ -79,11 +79,20 @@
|
||||
[opQueue addOperation:_connection];
|
||||
}
|
||||
|
||||
// This should NEVER be called from within a thread
|
||||
// owned by limelight-common
|
||||
- (void) stopStream
|
||||
{
|
||||
[_connection terminate];
|
||||
}
|
||||
|
||||
// This should only be called from within a thread
|
||||
// owned by limelight-common
|
||||
- (void) stopStreamInternal
|
||||
{
|
||||
[_connection terminateInternal];
|
||||
}
|
||||
|
||||
- (BOOL) launchApp:(HttpManager*)hMan {
|
||||
NSData* launchResp = [hMan executeRequestSynchronously:
|
||||
[hMan newLaunchRequest:_config.appID
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
}]];
|
||||
[self presentViewController:conTermAlert animated:YES completion:nil];
|
||||
|
||||
[_streamMan stopStream];
|
||||
[_streamMan stopStreamInternal];
|
||||
}
|
||||
|
||||
- (void) stageStarting:(char*)stageName {
|
||||
|
||||
Reference in New Issue
Block a user