package_daemon: fix crash on system update

We can't delete old volume state while it's still active and can be
accessed until reboot.

Fixes #10898

Signed-off-by: Augustin Cavalier <[email protected]>
Signed-off-by: Axel Dörfler <[email protected]>
This commit is contained in:
Sergey Avilov
2017-06-29 16:37:54 -04:00
committed by Augustin Cavalier
parent 5c0ae35297
commit d70f22ac30
+2 -1
View File
@@ -1238,7 +1238,8 @@ Volume::_SetLatestState(VolumeState* state, bool isActive)
fActiveState = state;
}
delete fLatestState;
if (fLatestState != fActiveState)
delete fLatestState;
fLatestState = state;
fChangeCount++;