From 995a1766542a8b819717ae19fc05da708eb223c4 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Mon, 17 Aug 2020 20:02:45 -0500 Subject: [PATCH] REVIEW: unique HTTPRepository is encapsulated within HTTPDirectory object. --- simgear/io/HTTPRepository.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/simgear/io/HTTPRepository.cxx b/simgear/io/HTTPRepository.cxx index c3369072..4bd2a215 100644 --- a/simgear/io/HTTPRepository.cxx +++ b/simgear/io/HTTPRepository.cxx @@ -630,6 +630,9 @@ HTTPRepository::HTTPRepository(const SGPath& base, HTTP::Client *cl) : // _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 + // REVIEW: _d is only partially initialized when it is being passed to the HTTPDirectory ctor. + // The HTTPDirectory object is taking ownership of the shared HTTPRepoPrivate object. + // Mismatch between _d being a unique_ptr, yet also cloned into HTTPDirectory. _d->rootDir = new HTTPDirectory(_d.get(), ""); _d->parseHashCache(); }