SF: Fix a scheduler related mock leak
After a recent change to inject mocks for use in the scheduler, it turns
out the mocks were being leaked, and the test was complaining about
such. However `atest libsurfaceflinger_unittest` hides those messages.
If you run the test directly, it complains "ERROR: 276 leaked mock
objects found at program exit." with a bunch more information about
which ones, and which tests were the source.
Its a one line change to fix the leak in all tests. This patch does so.
Test: libsurfaceflinger_unittest
Bug: None
Change-Id: Ifb4969c16dcf17a7c55777a3a3e3896273cab68f
diff --git a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
index 97fafcb..27a119b 100644
--- a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
+++ b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
@@ -368,6 +368,7 @@
mutableDrawingState().displays.clear();
mutableEventQueue().reset();
mutableInterceptor().reset();
+ mFlinger->mScheduler.reset();
mFlinger->mCompositionEngine->setHwComposer(std::unique_ptr<HWComposer>());
mFlinger->mCompositionEngine->setRenderEngine(
std::unique_ptr<renderengine::RenderEngine>());