Missing delete on MockSystemState.
The MockSysteState object leaks the UpdateAttempterMock every time
you create an instance, not only leaking the memory but also
skiping the mock expectations verification step. This patch fixes
that.
BUG=chromium:358278
TEST=Unit tests pass.
Change-Id: I13a3378c61bc9b108fcff7f4b6ed89397e96bd9d
Reviewed-on: https://chromium-review.googlesource.com/193112
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/mock_system_state.cc b/mock_system_state.cc
index 0ad110b..00e9c12 100644
--- a/mock_system_state.cc
+++ b/mock_system_state.cc
@@ -32,8 +32,9 @@
}
MockSystemState::~MockSystemState() {
- delete mock_gpio_handler_;
delete mock_connection_manager_;
+ delete mock_update_attempter_;
+ delete mock_gpio_handler_;
}
UpdateAttempter* MockSystemState::update_attempter() {