Debugger: Fix a memory leak.
TeamDebugger: - In several cases, BReferences on thread handlers after a call to _GetThreadHandler() weren't correctly initialized to account for that function implicitly acquiring a reference on our behalf, leading to the reference count to spiral out of control, and consequently the handler would never be freed. Found while attempting to address #13800, likely more to come.
This commit is contained in:
parent
16b34a8fc7
commit
8bb774fc37
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Copyright 2010-2016, Rene Gollent, rene@gollent.com.
|
||||
* Copyright 2010-2017, Rene Gollent, rene@gollent.com.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
@ -1532,7 +1532,7 @@ TeamDebugger::_HandleDebuggerMessage(DebugEvent* event)
|
||||
bool handled = false;
|
||||
|
||||
ThreadHandler* handler = _GetThreadHandler(event->Thread());
|
||||
BReference<ThreadHandler> handlerReference(handler);
|
||||
BReference<ThreadHandler> handlerReference(handler, true);
|
||||
|
||||
switch (event->EventType()) {
|
||||
case B_DEBUGGER_MESSAGE_THREAD_DEBUGGED:
|
||||
@ -1976,7 +1976,7 @@ TeamDebugger::_HandleImageDebugInfoChanged(image_id imageID)
|
||||
ObjectDeleter<ImageInfoPendingThread> threadDeleter(thread);
|
||||
locker.Lock();
|
||||
ThreadHandler* handler = _GetThreadHandler(thread->ThreadID());
|
||||
BReference<ThreadHandler> handlerReference(handler);
|
||||
BReference<ThreadHandler> handlerReference(handler, true);
|
||||
if (fTeam->StopOnImageLoad()) {
|
||||
|
||||
bool stop = true;
|
||||
|
Loading…
Reference in New Issue
Block a user