Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 2da3bf2

Browse files
committed
Fix issue where quartz did not mark as unavailable
1 parent 8026076 commit 2da3bf2

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/location-corelocation.m

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ - (void)markError
8989
pipeutils_signal(self.state->pipe_fd_write);
9090
}
9191

92+
- (void)markUnavailable
93+
{
94+
[self.state->lock lock];
95+
96+
self.state->available = 0;
97+
98+
[self.state->lock unlock];
99+
100+
pipeutils_signal(self.state->pipe_fd_write);
101+
}
102+
92103
- (void)locationManager:(CLLocationManager *)manager
93104
didUpdateLocations:(NSArray *)locations
94105
{
@@ -110,7 +121,11 @@ - (void)locationManager:(CLLocationManager *)manager
110121
{
111122
fprintf(stderr, _("Error obtaining location from CoreLocation: %s\n"),
112123
[[error localizedDescription] UTF8String]);
113-
[self markError];
124+
if ([error code] == kCLErrorDenied) {
125+
[self markError];
126+
} else {
127+
[self markUnavailable];
128+
}
114129
}
115130

116131
- (void)locationManager:(CLLocationManager *)manager

0 commit comments

Comments
 (0)