mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-15 21:22:40 +00:00
Stop using NSLog in internal functions because it seems to acquire a mutex that violates our locking order and causes deadlocks
This commit is contained in:
@@ -25,7 +25,7 @@ static NSLock *controllerStreamLock;
|
||||
GCController *controller = [GCController controllers][i];
|
||||
|
||||
if (controller != NULL) {
|
||||
NSLog(@"Controller connected!");
|
||||
printf("Controller connected!\n");
|
||||
controller.controllerPausedHandler = ^(GCController *controller) {
|
||||
// We call LiSendControllerEvent while holding a lock to prevent
|
||||
// multiple simultaneous calls since this function isn't thread safe.
|
||||
@@ -117,7 +117,7 @@ static NSLock *controllerStreamLock;
|
||||
[ControllerSupport registerControllerCallbacks];
|
||||
}];
|
||||
self.disconnectObserver = [[NSNotificationCenter defaultCenter] addObserverForName:GCControllerDidDisconnectNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
|
||||
NSLog(@"Controller disconnected!");
|
||||
printf("Controller disconnected!\n");
|
||||
}];
|
||||
|
||||
[ControllerSupport registerControllerCallbacks];
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
touchLocation = [touch locationInView:self];
|
||||
touchMoved = false;
|
||||
|
||||
NSLog(@"Touch down");
|
||||
printf("Touch down\n");
|
||||
}
|
||||
|
||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||
@@ -38,10 +38,10 @@
|
||||
}
|
||||
|
||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||
NSLog(@"Touch up");
|
||||
printf("Touch up\n");
|
||||
|
||||
if (!touchMoved) {
|
||||
NSLog(@"Sending left mouse button press");
|
||||
printf("Sending left mouse button press\n");
|
||||
|
||||
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user