Skip to content
Permalink
Browse files

Fix race condition in stats summary dock

(cherry-picked from 4012109)
  • Loading branch information
nyalldawson committed Jul 17, 2018
1 parent 98f3c62 commit 1cf5303bf664e3657c1db8326be3c3d13dfeefa3
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/app/qgsstatisticalsummarydockwidget.cpp
@@ -235,7 +235,10 @@ void QgsStatisticalSummaryDockWidget::gathererFinished()

void QgsStatisticalSummaryDockWidget::updateNumericStatistics()
{
if ( !mGatherer )
QgsStatisticsValueGatherer *gatherer = qobject_cast<QgsStatisticsValueGatherer *>( QObject::sender() );
// this may have been sent from a gathererer which was canceled previously and we don't care
// about it anymore...
if ( gatherer != mGatherer )
return;

QList< QVariant > variantValues = mGatherer->values();
@@ -301,7 +304,10 @@ void QgsStatisticalSummaryDockWidget::updateNumericStatistics()

void QgsStatisticalSummaryDockWidget::updateStringStatistics()
{
if ( !mGatherer )
QgsStatisticsValueGatherer *gatherer = qobject_cast<QgsStatisticsValueGatherer *>( QObject::sender() );
// this may have been sent from a gathererer which was canceled previously and we don't care
// about it anymore...
if ( gatherer != mGatherer )
return;

QVariantList values = mGatherer->values();
@@ -421,7 +427,10 @@ void QgsStatisticalSummaryDockWidget::layerSelectionChanged()

void QgsStatisticalSummaryDockWidget::updateDateTimeStatistics()
{
if ( !mGatherer )
QgsStatisticsValueGatherer *gatherer = qobject_cast<QgsStatisticsValueGatherer *>( QObject::sender() );
// this may have been sent from a gathererer which was canceled previously and we don't care
// about it anymore...
if ( gatherer != mGatherer )
return;

QVariantList values = mGatherer->values();

0 comments on commit 1cf5303

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