mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-27 21:04:22 +01:00
Fixed leak of unloaded module lists.
BUG= Change-Id: I6d03820082f793a2eac3c3c2abd184b4acf66aa4 Reviewed-on: https://chromium-review.googlesource.com/438755 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
parent
7ba80c7284
commit
64c2eda38a
@ -84,6 +84,7 @@ class MockMinidumpUnloadedModuleList : public MinidumpUnloadedModuleList {
|
||||
public:
|
||||
MockMinidumpUnloadedModuleList() : MinidumpUnloadedModuleList(NULL) {}
|
||||
|
||||
~MockMinidumpUnloadedModuleList() {}
|
||||
MOCK_CONST_METHOD0(Copy, CodeModules*());
|
||||
MOCK_CONST_METHOD1(GetModuleForAddress,
|
||||
const MinidumpUnloadedModule*(uint64_t));
|
||||
@ -400,11 +401,13 @@ TEST_F(MinidumpProcessorTest, TestUnloadedModules) {
|
||||
EXPECT_CALL(memory_list, GetMemoryRegionForAddress(_)).
|
||||
Times(0);
|
||||
|
||||
MockMinidumpUnloadedModuleList* unloaded_module_list_copy =
|
||||
new MockMinidumpUnloadedModuleList();
|
||||
EXPECT_CALL(unloaded_module_list, Copy()).
|
||||
WillOnce(Return(&unloaded_module_list));
|
||||
WillOnce(Return(unloaded_module_list_copy));
|
||||
|
||||
MockMinidumpUnloadedModule unloaded_module;
|
||||
EXPECT_CALL(unloaded_module_list, GetModuleForAddress(kExpectedEIP)).
|
||||
EXPECT_CALL(*unloaded_module_list_copy, GetModuleForAddress(kExpectedEIP)).
|
||||
WillOnce(Return(&unloaded_module));
|
||||
|
||||
MinidumpProcessor processor(reinterpret_cast<SymbolSupplier*>(NULL), NULL);
|
||||
|
@ -64,6 +64,7 @@ void ProcessState::Clear() {
|
||||
modules_with_corrupt_symbols_.clear();
|
||||
delete modules_;
|
||||
modules_ = NULL;
|
||||
delete unloaded_modules_;
|
||||
unloaded_modules_ = NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user