Skip to content

Commit 1a78d8e

Browse files
authored
fix: Leak when clearing debug output stream (#101)
1 parent 1d3c537 commit 1a78d8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Notecard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ void Notecard::begin(NoteSerial * noteSerial_)
257257
/**************************************************************************/
258258
void Notecard::clearDebugOutputStream(void)
259259
{
260-
noteLog = nullptr;
261-
NoteSetFnDebugOutput(nullptr);
260+
setDebugOutputStream(nullptr);
262261
}
263262

264263
/**************************************************************************/
@@ -445,6 +444,7 @@ void Notecard::setDebugOutputStream(NoteLog * noteLog_)
445444
if (noteLog) {
446445
NoteSetFnDebugOutput(noteLogPrint);
447446
} else {
447+
make_note_log(nullptr); // Clear singleton
448448
NoteSetFnDebugOutput(nullptr);
449449
}
450450
}

0 commit comments

Comments
 (0)