From a8c13cf0412f27bafd8905c04a30f2c406080dbb Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Mon, 17 Aug 2020 19:35:06 -0500 Subject: [PATCH] REVIEW: Memory Leak - HTTPDirectory 885,598 (3,072 direct, 882,526 indirect) bytes in 48 blocks are definitely lost. Candidate for shared_ptr or destruction within parent's dtor. --- simgear/io/HTTPRepository.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simgear/io/HTTPRepository.cxx b/simgear/io/HTTPRepository.cxx index 52b87498..c3369072 100644 --- a/simgear/io/HTTPRepository.cxx +++ b/simgear/io/HTTPRepository.cxx @@ -626,6 +626,10 @@ HTTPRepository::HTTPRepository(const SGPath& base, HTTP::Client *cl) : { _d->http = cl; _d->basePath = base; + // REVIEW: Memory Leak - 885,598 (3,072 direct, 882,526 indirect) bytes in 48 blocks are definitely lost + // _d->rootDir should be changed to a shared_ptr + // this object is passed to several chained methods, so destruction within ~HTTPRepoPrivate may be + // an easier fix assuming sole ownership would apply _d->rootDir = new HTTPDirectory(_d.get(), ""); _d->parseHashCache(); }