Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfb122d9 authored by Kean Mariotti's avatar Kean Mariotti
Browse files

Fix lambda capture

The scheduled takeLayersSnapshotProto() call is not waited anymore
(see deadlock fix for b/313130597), hence the traceFlags local
variable must be captured by value to avoid referencing it after
it goes out of scope.

Fix: 370018409
Flag: EXEMPT bugfix
Test: presubmit
Change-Id: I0285ba70475cec3e4c54787303aea535bf866d72
parent 26e74e58
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -952,7 +952,7 @@ void SurfaceFlinger::init() FTL_FAKE_GUARD(kMainThreadContext) {
                // Do not wait the future to avoid deadlocks
                // between main and Perfetto threads (b/313130597)
                static_cast<void>(mScheduler->schedule(
                        [&, onLayersSnapshot]() FTL_FAKE_GUARD(mStateLock)
                        [&, traceFlags, onLayersSnapshot]() FTL_FAKE_GUARD(mStateLock)
                                FTL_FAKE_GUARD(kMainThreadContext) {
                                    auto snapshot =
                                            takeLayersSnapshotProto(traceFlags, TimePoint::now(),