mirror of
https://github.com/swisspol/GCDWebServer.git
synced 2026-04-24 00:00:04 +08:00
Adding check to _endBackgroundTask to verify the application exists before calling GWS_DNOT_REACHED.
This enables what is admittedly a rare scenario which is running these servers inside application-less unit tests where there is no UIApplication.
This commit is contained in:
@@ -283,7 +283,7 @@ static void _ExecuteMainThreadRunLoopSources() {
|
|||||||
[[UIApplication sharedApplication] endBackgroundTask:_backgroundTask];
|
[[UIApplication sharedApplication] endBackgroundTask:_backgroundTask];
|
||||||
_backgroundTask = UIBackgroundTaskInvalid;
|
_backgroundTask = UIBackgroundTaskInvalid;
|
||||||
GWS_LOG_DEBUG(@"Did end background task");
|
GWS_LOG_DEBUG(@"Did end background task");
|
||||||
} else {
|
} else if ([UIApplication sharedApplication]) {
|
||||||
GWS_DNOT_REACHED();
|
GWS_DNOT_REACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user