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

Commit 9cf5a872 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "fix segmentation fault of GraphicsComposerAidlCommandTest"

parents 2530f9ca d0dbe4ef
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;
}