Skip to content

Commit

Permalink
Fix race condition in stats summary dock
Browse files Browse the repository at this point in the history
(cherry-picked from 4012109)
  • Loading branch information
nyalldawson committed Jul 17, 2018
1 parent 98f3c62 commit 1cf5303
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/app/qgsstatisticalsummarydockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1cf5303

Please sign in to comment.