libhardware: fix a use after free warning.

This fixes the warning that mModule is used
after being freed.

BUG: None
Test: The warning is gone.
Change-Id: I8d081b544f0bcd69559a10dd3e925ce5cf065c28
This commit is contained in:
Yunlian Jiang 2016-11-08 15:18:42 -08:00
parent cfd950b679
commit ce3cd0cf4a

View file

@ -74,7 +74,6 @@ struct CameraModuleFixture {
void TearDown() {
TEST_EXTENSION_FORKING_TEAR_DOWN;
delete mModule;
TearDownMixin();
/* important: device must be destructed before closing module,
@ -85,6 +84,7 @@ struct CameraModuleFixture {
ASSERT_EQ(0, HWModuleHelpers::closeModule(mModule->getDso()))
<< "Failed to close camera HAL module";
}
delete mModule;
}
void CreateCamera(int cameraID, /*out*/ sp<CameraDeviceBase> *device) {