mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-06 14:52:34 +02:00
Fix one scalar naked new that crept back in
This commit is contained in:
parent
38236a807c
commit
bb5dc07c51
@ -1090,16 +1090,16 @@ void SpecCache::Populate
|
|||||||
// Storage for mutable per-thread data.
|
// Storage for mutable per-thread data.
|
||||||
// private clause ensures one copy per thread
|
// private clause ensures one copy per thread
|
||||||
struct ThreadLocalStorage {
|
struct ThreadLocalStorage {
|
||||||
ThreadLocalStorage() { cache = nullptr; }
|
ThreadLocalStorage() { }
|
||||||
~ThreadLocalStorage() { delete cache; }
|
~ThreadLocalStorage() { }
|
||||||
|
|
||||||
void init(WaveTrackCache &waveTrackCache, size_t scratchSize) {
|
void init(WaveTrackCache &waveTrackCache, size_t scratchSize) {
|
||||||
if (!cache) {
|
if (!cache) {
|
||||||
cache = new WaveTrackCache(waveTrackCache.GetTrack());
|
cache = std::make_unique<WaveTrackCache>(waveTrackCache.GetTrack());
|
||||||
scratch.resize(scratchSize);
|
scratch.resize(scratchSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WaveTrackCache* cache;
|
std::unique_ptr<WaveTrackCache> cache;
|
||||||
std::vector<float> scratch;
|
std::vector<float> scratch;
|
||||||
} tls;
|
} tls;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user