Merge "make shutdown safe for double calls."
am: 71fa1068de
Change-Id: I161c96dc5a44890fffe8fcdf9e0f8fc874df29c0
This commit is contained in:
commit
2f93c657f4
1 changed files with 5 additions and 0 deletions
|
@ -633,8 +633,13 @@ int VolumeManager::reset() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Can be called twice (sequentially) during shutdown. should be safe for that.
|
||||||
int VolumeManager::shutdown() {
|
int VolumeManager::shutdown() {
|
||||||
|
if (mInternalEmulated == nullptr) {
|
||||||
|
return 0; // already shutdown
|
||||||
|
}
|
||||||
mInternalEmulated->destroy();
|
mInternalEmulated->destroy();
|
||||||
|
mInternalEmulated = nullptr;
|
||||||
for (const auto& disk : mDisks) {
|
for (const auto& disk : mDisks) {
|
||||||
disk->destroy();
|
disk->destroy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue