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

Commit 79b87fa1 authored by Ying Wei's avatar Ying Wei Committed by Automerger Merge Worker
Browse files

Grab lock before reparenting in SurfaceFlinger commitMirrorDisplays() am: 2cf827fa

parents f3dc8816 2cf827fa
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -7913,10 +7913,15 @@ bool SurfaceFlinger::commitMirrorDisplays(VsyncId vsyncId) {
                                         ISurfaceComposerClient::eNoColorFill,
                                         gui::LayerMetadata());
            sp<Layer> childMirror;
            {
                Mutex::Autolock lock(mStateLock);
                createEffectLayer(mirrorArgs, &unused, &childMirror);
                childMirror->setClonedChild(layer->createClone());
                childMirror->reparent(mirrorDisplay.rootHandle);
            }
            // lock on mStateLock needs to be released before binder handle gets destroyed
            unused.clear();
        }
    }
    return true;
}