Commit e076ad05 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

SqliteConnection: Remove now unused release method

parent 4d882a40
......@@ -109,9 +109,6 @@ MediaLibrary::~MediaLibrary()
Playlist::clear();
History::clear();
Genre::clear();
// Explicitely release the connection's TLS
if ( m_dbConnection != nullptr )
m_dbConnection->release();
}
bool MediaLibrary::createAllTables()
......
......@@ -61,18 +61,12 @@ SqliteConnection::Handle SqliteConnection::getConn()
s.execute();
while ( s.row() != nullptr )
;
m_conns.emplace(std::this_thread::get_id(), ConnPtr( dbConnection, &sqlite3_close ) );
m_conns.emplace( std::this_thread::get_id(), ConnPtr( dbConnection, &sqlite3_close ) );
return dbConnection;
}
return it->second.get();
}
void SqliteConnection::release()
{
std::unique_lock<std::mutex> lock( m_connMutex );
m_conns.erase( std::this_thread::get_id() );
}
std::unique_ptr<sqlite::Transaction> SqliteConnection::newTransaction()
{
return std::unique_ptr<sqlite::Transaction>{ new sqlite::Transaction( this ) };
......
......@@ -49,8 +49,6 @@ public:
// Returns the current thread's connection
// This will initiate a connection if required
Handle getConn();
// Release the current thread's connection
void release();
std::unique_ptr<sqlite::Transaction> newTransaction();
ReadContext acquireReadContext();
WriteContext acquireWriteContext();
......
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