Skip to content

Commit

Permalink
Fix deadlock and crash when building locator cache
Browse files Browse the repository at this point in the history
Fix #53956
  • Loading branch information
elpaso committed Feb 5, 2024
1 parent 0c8b576 commit 1b71b39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/core/qgspointlocator.cpp
Expand Up @@ -1006,6 +1006,7 @@ bool QgsPointLocator::init( int maxFeaturesToIndex, bool relaxed )

void QgsPointLocator::waitForIndexingFinished()
{

disconnect( mInitTask, &QgsPointLocatorInitTask::taskTerminated, this, &QgsPointLocator::onInitTaskFinished );
disconnect( mInitTask, &QgsPointLocatorInitTask::taskCompleted, this, &QgsPointLocator::onInitTaskFinished );
mInitTask->waitForFinished();
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgssnappingutils.cpp
Expand Up @@ -235,15 +235,15 @@ static void _updateBestMatch( QgsPointLocator::Match &bestMatch, const QgsPointX
}
if ( type & QgsPointLocator::Centroid )
{
_replaceIfBetter( bestMatch, loc->nearestCentroid( pointMap, tolerance, filter ), tolerance );
_replaceIfBetter( bestMatch, loc->nearestCentroid( pointMap, tolerance, filter, relaxed ), tolerance );
}
if ( type & QgsPointLocator::MiddleOfSegment )
{
_replaceIfBetter( bestMatch, loc->nearestMiddleOfSegment( pointMap, tolerance, filter ), tolerance );
_replaceIfBetter( bestMatch, loc->nearestMiddleOfSegment( pointMap, tolerance, filter, relaxed ), tolerance );
}
if ( type & QgsPointLocator::LineEndpoint )
{
_replaceIfBetter( bestMatch, loc->nearestLineEndpoints( pointMap, tolerance, filter ), tolerance );
_replaceIfBetter( bestMatch, loc->nearestLineEndpoints( pointMap, tolerance, filter, relaxed ), tolerance );
}
}

Expand Down

0 comments on commit 1b71b39

Please sign in to comment.