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

Commit ef44568c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "fix segmentation fault of GraphicsComposerAidlCommandTest" am:...

Merge "fix segmentation fault of GraphicsComposerAidlCommandTest" am: 9cf5a872 am: 2a2ce43e am: b515796c am: 5555447a

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2198035



Change-Id: Id132f9d8e62f8e535c4fe0bda775195c009dcfd7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 04502b44 5555447a
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -488,10 +488,13 @@ bool VtsComposerClient::verifyComposerCallbackParams() {
}

bool VtsComposerClient::destroyAllLayers() {
    for (const auto& it : mDisplayResources) {
        const auto& [display, resource] = it;
    std::unordered_map<int64_t, DisplayResource> physicalDisplays;
    while (!mDisplayResources.empty()) {
        const auto& it = mDisplayResources.begin();
        const auto& [display, resource] = *it;

        for (auto layer : resource.layers) {
        while (!resource.layers.empty()) {
            auto layer = *resource.layers.begin();
            const auto status = destroyLayer(display, layer);
            if (!status.isOk()) {
                ALOGE("Unable to destroy all the layers, failed at layer %" PRId64 " with error %s",
@@ -507,8 +510,12 @@ bool VtsComposerClient::destroyAllLayers() {
                      status.getDescription().c_str());
                return false;
            }
        } else {
            auto extractIter = mDisplayResources.extract(it);
            physicalDisplays.insert(std::move(extractIter));
        }
    }
    mDisplayResources.swap(physicalDisplays);
    mDisplayResources.clear();
    return true;
}