Skip to content

Commit

Permalink
Document QgsOgrConnPool::{ref,unref}
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Feb 3, 2016
1 parent 060dca6 commit f9b77f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/providers/ogr/qgsogrconnpool.h
Expand Up @@ -105,6 +105,15 @@ class QgsOgrConnPool : public QgsConnectionPool<QgsOgrConn*, QgsOgrConnPoolGroup
//
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 )
{
mMutex.lock();
Expand All @@ -115,6 +124,10 @@ class QgsOgrConnPool : public QgsConnectionPool<QgsOgrConn*, QgsOgrConnPoolGroup
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 )
{
mMutex.lock();
Expand Down

0 comments on commit f9b77f3

Please sign in to comment.