Commit 81aeed08 authored by Thomas Van Lenten's avatar Thomas Van Lenten

Work around the static analyzer false report.

parent 953adb16
......@@ -753,6 +753,12 @@ void GPBPrepareReadOnlySemaphore(GPBMessage *self) {
if (!atomic_compare_exchange_strong(&self->readOnlySemaphore_, &expected, worker)) {
dispatch_release(worker);
}
#if defined(__clang_analyzer__)
// The Xcode 9.2 (and 9.3 beta) static analyzer thinks worker is leaked
// (doesn't seem to know about atomic_compare_exchange_strong); so just
// for the analyzer, let it think worker is also released in this case.
else { dispatch_release(worker); }
#endif
}
#pragma clang diagnostic pop
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment