Skip to content
Permalink
Browse files

Document QgsOgrConnPool::{ref,unref}

  • Loading branch information
manisandro committed Feb 3, 2016
1 parent 060dca6 commit f9b77f3fa586e97192eedacec96a7d9bc24fba73
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/providers/ogr/qgsogrconnpool.h
@@ -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();
@@ -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();

0 comments on commit f9b77f3

Please sign in to comment.
You can’t perform that action at this time.