Loading services/gpuservice/tests/unittests/GpuStatsTest.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,12 @@ public: ::testing::UnitTest::GetInstance()->current_test_info(); ALOGD("**** Tearing down after %s.%s\n", test_info->test_case_name(), test_info->name()); // This is required for test due to GpuStats instance spawns binder transactions // in its destructor. After the gtest destructor test exits immidiatelly. // It results in binder thread not able to process above binder transactions and memory leak // occures. Binder thread needs time to process callbacks transactions. // It leads to GpuStats instance destructor needs to be called in advance. mGpuStats.reset(nullptr); // performs all pending callbacks until all data has been consumed // gives time to process binder transactions by thread pool looper->pollAll(1000); Loading Loading
services/gpuservice/tests/unittests/GpuStatsTest.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,12 @@ public: ::testing::UnitTest::GetInstance()->current_test_info(); ALOGD("**** Tearing down after %s.%s\n", test_info->test_case_name(), test_info->name()); // This is required for test due to GpuStats instance spawns binder transactions // in its destructor. After the gtest destructor test exits immidiatelly. // It results in binder thread not able to process above binder transactions and memory leak // occures. Binder thread needs time to process callbacks transactions. // It leads to GpuStats instance destructor needs to be called in advance. mGpuStats.reset(nullptr); // performs all pending callbacks until all data has been consumed // gives time to process binder transactions by thread pool looper->pollAll(1000); Loading