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

Skip to content
Commit 101d8dc0 authored by Dan Stoza's avatar Dan Stoza
Browse files

SF: Fix mGraphicBufferProducerList

This change is primarily to fix a memory leak discovered while
investigating bug 73792507. It turned out that while we were adding
every new IGBP to SF's list (which it uses for authentication), we were
never removing anything from that list, causing us to leak wp<> items.

The root cause was some subtlety around MonitoredProducer, which wraps
a generic IGBP in order to allow SF to perform some work when one is
destroyed. When we were adding elements to mGBPL, we were adding the
address of the MonitoredProducer, but upon destruction, the
MonitoredProducer was trying to remove the address of its wrapped IGBP,
which, naturally, wasn't present in the list.

In order to address this, the key functional change here is to pass the
IBinder address of the MonitoredProducer from its destructor rather
than that of the wrapped IGBP.

On top of the bug fix, however, this also switches from a custom
MessageBase-derived class to LambdaMessage and converts mGBPL from a
SortedVector to a std::set.

Bug: 73792507
Test: Manual - log lines to verify mGBPL no longer increases over time
Change-Id: Idabae211354561a0f13c8d9e594c7acc4822aab0
parent 08300cf5
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