hrev51716 adds 1 changeset to branch 'master'
old head: 16b34a8fc758f64fd6ad69d3f6b77bc810db35c8
new head: 8bb774fc375e2645c85f91c7dd629740e9f76cce
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=8bb774fc375e+%5E16b34a8fc758
----------------------------------------------------------------------------
8bb774fc375e: 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.
[ Rene Gollent <rene@xxxxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev51716
Commit: 8bb774fc375e2645c85f91c7dd629740e9f76cce
URL: http://cgit.haiku-os.org/haiku/commit/?id=8bb774fc375e
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Thu Dec 28 04:49:45 2017 UTC
Ticket: https://dev.haiku-os.org/ticket/13800
----------------------------------------------------------------------------
1 file changed, 3 insertions(+), 3 deletions(-)
src/kits/debugger/controllers/TeamDebugger.cpp | 6 +++---
----------------------------------------------------------------------------
diff --git a/src/kits/debugger/controllers/TeamDebugger.cpp
b/src/kits/debugger/controllers/TeamDebugger.cpp
index faf3944..d5b3cda 100644
--- a/src/kits/debugger/controllers/TeamDebugger.cpp
+++ b/src/kits/debugger/controllers/TeamDebugger.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@xxxxxx.
- * Copyright 2010-2016, Rene Gollent, rene@xxxxxxxxxxx.
+ * Copyright 2010-2017, Rene Gollent, rene@xxxxxxxxxxx.
* 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;