Commit 4f0423c3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibrary: Split cache clearing code out of destructor

parent e707aeff
......@@ -107,6 +107,11 @@ MediaLibrary::~MediaLibrary()
m_discovererWorker->stop();
if ( m_parser != nullptr )
m_parser->stop();
clearCache();
}
void MediaLibrary::clearCache()
{
Media::clear();
Folder::clear();
Label::clear();
......
......@@ -175,6 +175,7 @@ class MediaLibrary : public IMediaLibrary, public IDeviceListerCb
virtual bool onDevicePlugged( const std::string& uuid, const std::string& mountpoint ) override;
virtual void onDeviceUnplugged(const std::string& uuid) override;
virtual bool isDeviceKnown( const std::string& uuid ) const override;
void clearCache();
protected:
std::shared_ptr<sqlite::Connection> m_dbConnection;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment