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

Skip to content
Commit e22f033f authored by Lloyd Pique's avatar Lloyd Pique
Browse files

[SF] Fix unittest crash

Some of the values passed to HWC2::Display by FakeHwcDisplayInjector as
used by the test were passed by reference, with the reference being
owned by the injector.

However, the lifetime of the injector was effectively temporary, and so
the constructed Display instance ended up holding a reference to a dead
instance.

This patch uses statically constructed default values for those
parameters instead, so that the values will not be destroyed. The test
code can also still override the values used if non-default values are
ever desired.

It also adds a comment warning of the possibility so it hopefully does
not happen again.

Bug: 111454533
Test: Unit test runs without crashing
Change-Id: I8dfe6e31111a558a7892f0eef91bd96b8dd71f59
parent dfabb598
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment