Skip to content

Commit

Permalink
tidy: Quiet "potential memory leak" warning.
Browse files Browse the repository at this point in the history
This memory leak warning is a false positive.  The ImportNative object
is added to a list in its constructor, several levels up the
inheritance chain in the constructor for a MythUIType object.

https://clang.llvm.org/docs/analyzer/checkers.html#cplusplus-newdeleteleaks
  • Loading branch information
linuxdude42 committed Sep 20, 2024
1 parent 8149632 commit 7b2b857
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mythplugins/mytharchive/mytharchive/importnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ void ArchiveFileSelector::nextPressed()
if (native->Create())
mainStack->AddScreen(native);
}
// No memory leak. ImportNative (via MythUIType) adds the new item
// onto the parent mainStack.
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
}

void ArchiveFileSelector::prevPressed()
Expand Down

0 comments on commit 7b2b857

Please sign in to comment.