Skip to content
Permalink
Browse files

Workaround bug in Qt > 5.8 causing crashes in connection pools

  • Loading branch information
nyalldawson committed Nov 9, 2017
1 parent 4c78526 commit fef56184bc0324822cbac54bad2b19428266dec4
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/core/qgsconnectionpool.h
@@ -95,8 +95,19 @@ class QgsConnectionPoolGroup
T acquire( int timeout )
{
// we are going to acquire a resource - if no resource is available, we will block here
if ( !sem.tryAcquire( 1, timeout ) )
return nullptr;
if ( timeout >= 0 )
{
if ( !sem.tryAcquire( 1, timeout ) )
return nullptr;
}
else
{
// we should still be able to use tryAcquire with a negative timeout here, but
// tryAcquire is broken on Qt > 5.8 with negative timeouts - see
// https://bugreports.qt.io/browse/QTBUG-64413
// https://lists.osgeo.org/pipermail/qgis-developer/2017-November/050456.html
sem.acquire( 1 );
}

// quick (preferred) way - use cached connection
{

0 comments on commit fef5618

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