Skip to content

Commit 178996e

Browse files
committed
fix leak
1 parent 1475664 commit 178996e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

1.9.camera/camera.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ void CheckIfProcessTrusted() {
2222
sizeof(keys) / sizeof(keys[0]),
2323
&kCFTypeDictionaryKeyCallBacks,
2424
&kCFTypeDictionaryValueCallBacks);
25-
if (!AXIsProcessTrustedWithOptions(options)) {
25+
const bool trusted = AXIsProcessTrustedWithOptions(options);
26+
CFRelease(options);
27+
if (!trusted) {
2628
throw std::runtime_error("not a trusted trusted accessibility client");
2729
}
28-
CFRelease(options);
2930
#endif
3031
}
3132

0 commit comments

Comments
 (0)