mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-28 16:50:10 +00:00
8378727: [macOS] Missing dispatch_release for semaphores in CDesktopPeer
Reviewed-by: honkar, kizune, azvegint, dmarkov
This commit is contained in:
parent
abb9c33ced
commit
d52e5bd035
@ -70,6 +70,7 @@ JNI_COCOA_ENTER(env);
|
||||
dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(NSEC_PER_SEC)); // 1 second timeout
|
||||
|
||||
// Asynchronous call to openURL
|
||||
dispatch_retain(semaphore);
|
||||
[[NSWorkspace sharedWorkspace] openURLs:urls
|
||||
withApplicationAtURL:appURI
|
||||
configuration:configuration
|
||||
@ -78,9 +79,11 @@ JNI_COCOA_ENTER(env);
|
||||
status = (OSStatus) error.code;
|
||||
}
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
dispatch_release(semaphore);
|
||||
}];
|
||||
|
||||
dispatch_semaphore_wait(semaphore, timeout);
|
||||
dispatch_release(semaphore);
|
||||
|
||||
JNI_COCOA_EXIT(env);
|
||||
return status;
|
||||
@ -146,6 +149,7 @@ JNI_COCOA_ENTER(env);
|
||||
dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(NSEC_PER_SEC)); // 1 second timeout
|
||||
|
||||
// Asynchronous call - openURLs:withApplicationAtURL
|
||||
dispatch_retain(semaphore);
|
||||
[[NSWorkspace sharedWorkspace] openURLs:urls
|
||||
withApplicationAtURL:appURI
|
||||
configuration:configuration
|
||||
@ -154,9 +158,11 @@ JNI_COCOA_ENTER(env);
|
||||
status = (OSStatus) error.code;
|
||||
}
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
dispatch_release(semaphore);
|
||||
}];
|
||||
|
||||
dispatch_semaphore_wait(semaphore, timeout);
|
||||
dispatch_release(semaphore);
|
||||
|
||||
[urlToOpen release];
|
||||
JNI_COCOA_EXIT(env);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user