Work around the static analyzer false report.

pull/4263/head
Thomas Van Lenten 7 years ago
parent 953adb16ff
commit 81aeed082e
  1. 6
      objectivec/GPBMessage.m

@ -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

Loading…
Cancel
Save