Skip to content

Commit

Permalink
REGRESSION (Sonoma?): [ Sonoma release ] TestWebKitAPI.SleepDisabler.…
Browse files Browse the repository at this point in the history
…Crash is a flaky crash

https://bugs.webkit.org/show_bug.cgi?id=263150
rdar://116942464

Reviewed by Jer Noble.

Move ALWAYS_LOG() call inside the `if (weakThis)` scope since the macros ends up using
`this`.

* Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
(WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):

Canonical link: https://commits.webkit.org/269342@main
  • Loading branch information
cdumez committed Oct 14, 2023
1 parent 9f6c6e9 commit 4c21734
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@
m_arbitrationStatus = ArbitrationStatus::Pending;
m_arbitrationUpdateTime = WallTime::now();
SharedRoutingArbitrator::sharedInstance().beginRoutingArbitrationForToken(m_token, category, [this, weakThis = WeakPtr { *this }, callback = WTFMove(callback), identifier = WTFMove(identifier)] (RoutingArbitrationError error, DefaultRouteChanged routeChanged) mutable {
ALWAYS_LOG(identifier, "callback, error = ", error, ", routeChanged = ", routeChanged);
if (weakThis)
if (weakThis) {
ALWAYS_LOG(identifier, "callback, error = ", error, ", routeChanged = ", routeChanged);
weakThis->m_arbitrationStatus = error == RoutingArbitrationError::None ? ArbitrationStatus::Active : ArbitrationStatus::None;
}
callback(error, routeChanged);
});
}
Expand Down

0 comments on commit 4c21734

Please sign in to comment.