# HG changeset patch # User Sebastien Jodogne # Date 1733832445 -3600 # Node ID af8ebf590a297f9fcf183e42c80562bf4e2bd980 # Parent 39936650edc1436ddf9974e8044cec0247245a99 fix memory leak diff -r 39936650edc1 -r af8ebf590a29 Framework/Inputs/OnTheFlyPyramidsCache.cpp --- a/Framework/Inputs/OnTheFlyPyramidsCache.cpp Tue Dec 10 12:57:40 2024 +0100 +++ b/Framework/Inputs/OnTheFlyPyramidsCache.cpp Tue Dec 10 13:07:25 2024 +0100 @@ -139,6 +139,21 @@ } + OnTheFlyPyramidsCache::~OnTheFlyPyramidsCache() + { + while (!cache_.IsEmpty()) + { + CachedPyramid* pyramid = NULL; + cache_.RemoveOldest(pyramid); + + if (pyramid != NULL) + { + delete pyramid; + } + } + } + + void OnTheFlyPyramidsCache::InitializeInstance(IPyramidFetcher *fetcher, size_t maxSize, size_t maxMemory) diff -r 39936650edc1 -r af8ebf590a29 Framework/Inputs/OnTheFlyPyramidsCache.h --- a/Framework/Inputs/OnTheFlyPyramidsCache.h Tue Dec 10 12:57:40 2024 +0100 +++ b/Framework/Inputs/OnTheFlyPyramidsCache.h Tue Dec 10 13:07:25 2024 +0100 @@ -73,6 +73,8 @@ size_t maxMemory); public: + ~OnTheFlyPyramidsCache(); + static void InitializeInstance(IPyramidFetcher* fetcher, size_t maxSize, size_t maxMemory);