Skip to content

Commit 7f5b5fe

Browse files
committedJul 8, 2015
Destroy connection pool groups when connection pool is destroyed
1 parent 30daef0 commit 7f5b5fe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/core/qgsconnectionpool.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ class QgsConnectionPool
228228

229229
typedef QMap<QString, T_Group*> T_Groups;
230230

231+
virtual ~QgsConnectionPool()
232+
{
233+
mMutex.lock();
234+
foreach ( T_Group* group, mGroups )
235+
{
236+
delete group;
237+
}
238+
mGroups.clear();
239+
mMutex.unlock();
240+
}
241+
231242
//! Try to acquire a connection: if no connections are available, the thread will get blocked.
232243
//! @return initialized connection or null on error
233244
T acquireConnection( const QString& connInfo )

0 commit comments

Comments
 (0)
Please sign in to comment.