Document QgsOgrConnPool::{ref,unref}

This commit is contained in:
Sandro Mani 2016-02-03 11:40:11 +01:00
parent 060dca671e
commit f9b77f3fa5

View File

@ -105,6 +105,15 @@ class QgsOgrConnPool : public QgsConnectionPool<QgsOgrConn*, QgsOgrConnPoolGroup
// //
static void cleanupInstance(); static void cleanupInstance();
/**
* @brief Increases the reference count on the connection pool for the specified connection.
* @param connInfo The connection string.
* @note
* Any user of the connection pool needs to increase the reference count
* before it acquires any connections and decrease the reference count after
* releasing all acquired connections to ensure that all open OGR handles
* are freed when and only when no one is using the pool anymore.
*/
void ref( const QString& connInfo ) void ref( const QString& connInfo )
{ {
mMutex.lock(); mMutex.lock();
@ -115,6 +124,10 @@ class QgsOgrConnPool : public QgsConnectionPool<QgsOgrConn*, QgsOgrConnPoolGroup
mMutex.unlock(); mMutex.unlock();
} }
/**
* @brief Decrease the reference count on the connection pool for the specified connection.
* @param connInfo The connection string.
*/
void unref( const QString& connInfo ) void unref( const QString& connInfo )
{ {
mMutex.lock(); mMutex.lock();