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.
This commit is contained in:
Scott Giese
2020-08-17 19:35:06 -05:00
parent d79ecddaf9
commit a8c13cf041

View File

@@ -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();
}