Skip to content

Commit

Permalink
HPCC-33259: Fix CModularTracer memory leak
Browse files Browse the repository at this point in the history
Own the default sink before insertion into the sink map. THe owned reference
will be released, leaving only the map's reference.

Signed-off-by: Tim Klemm <[email protected]>
  • Loading branch information
Tim Klemm authored and Tim Klemm committed Jan 16, 2025
1 parent 421e8fd commit 0cd1558
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/masking/include/tracer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class CModularTracer : public CBaseTracer
public:
CModularTracer()
{
setSink(DefaultHelperName, new CStandardTraceMsgSink());
Owned<IModularTraceMsgSink> sink(new CStandardTraceMsgSink());
setSink(DefaultHelperName, sink);
}
inline bool setSink(IModularTraceMsgSink* sink)
{
Expand Down

0 comments on commit 0cd1558

Please sign in to comment.