Nicer way to deal with the shared audiothumbnailcache

This commit is contained in:
xenakios
2017-11-23 19:36:46 +02:00
parent a109d71f09
commit e9e1c45550
4 changed files with 11 additions and 20 deletions

View File

@ -154,15 +154,8 @@ void PaulstretchpluginAudioProcessorEditor::chooseFile()
}
}
std::shared_ptr<AudioThumbnailCache> g_thumbcache;
WaveformComponent::WaveformComponent(AudioFormatManager* afm)
{
if (g_thumbcache == nullptr)
{
g_thumbcache = std::make_shared<AudioThumbnailCache>(100);
}
m_thumbcache = g_thumbcache;
TimeSelectionChangedCallback = [](Range<double>, int) {};
if (m_use_opengl == true)
m_ogl.attachTo(*this);
@ -438,10 +431,3 @@ int WaveformComponent::getTimeSelectionEdge(int x, int y)
return 0;
}
void cleanUpGUI()
{
if (g_thumbcache.unique())
{
g_thumbcache = nullptr;
}
}