Corrected a bug when "expanding" an existing preloaded file: the unique_ptr was not released properly

This commit is contained in:
paulfd 2019-09-16 15:12:15 +02:00
parent e028fdced9
commit 455075ec64

View file

@ -79,7 +79,7 @@ std::optional<sfz::FilePool::FileInformation> sfz::FilePool::getFileInformation(
if (preloadedData.contains(filename)) {
auto alreadyPreloaded = preloadedData[filename];
if (preloadedSize > alreadyPreloaded->getNumFrames()) {
alreadyPreloaded.reset(readFromFile<float>(sndFile, preloadedSize).get());
alreadyPreloaded.reset(readFromFile<float>(sndFile, preloadedSize).release());
}
returnedValue.preloadedData = alreadyPreloaded;
} else {