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

Commit 9e9800c5 authored by Lloyd Pique's avatar Lloyd Pique
Browse files

SF: Fix for a leaked mock reported in processesVirtualDisplayAdded

I'm not sure why it only started being reported  recently, but removing
the injected virtual display from the SurfaceFlinger current/drawing
state fixes the leak.

Bug: None
Test: adb shell libsurfaceflinger_unittest
Change-Id: Ibaf1a8878e296707b9fbbd0a647908cc1205cdc2
parent 79555a7a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1926,6 +1926,10 @@ TEST_F(HandleTransactionLockedTest, processesVirtualDisplayAdded) {
    EXPECT_CALL(*mComposer, destroyVirtualDisplay(Case::Display::HWC_DISPLAY_ID))
            .WillOnce(Return(Error::NONE));
    EXPECT_CALL(*mConsumer, consumerDisconnect()).WillOnce(Return(NO_ERROR));

    // Cleanup
    mFlinger.mutableCurrentState().displays.removeItem(displayToken);
    mFlinger.mutableDrawingState().displays.removeItem(displayToken);
}

TEST_F(HandleTransactionLockedTest, processesVirtualDisplayAddedWithNoSurface) {