@@ -702,12 +702,12 @@ bool QgsVectorLayer::countSymbolFeatures()
702
702
703
703
if ( !mFeatureCounter )
704
704
{
705
- mFeatureCounter . reset ( new QgsVectorLayerFeatureCounter ( this ) );
706
- connect ( mFeatureCounter . get () , &QgsVectorLayerFeatureCounter::symbolsCounted, this , &QgsVectorLayer::onSymbolsCounted );
707
- connect ( mFeatureCounter . get () , &QgsTask::taskCompleted, [ = ]() { mFeatureCounter . reset () ; } );
708
- connect ( mFeatureCounter . get () , &QgsTask::taskTerminated, [ = ]() { mFeatureCounter . reset () ; } );
705
+ mFeatureCounter = new QgsVectorLayerFeatureCounter ( this );
706
+ connect ( mFeatureCounter , &QgsVectorLayerFeatureCounter::symbolsCounted, this , &QgsVectorLayer::onSymbolsCounted );
707
+ connect ( mFeatureCounter , &QgsTask::taskCompleted, [ = ]() { mFeatureCounter = nullptr ; } );
708
+ connect ( mFeatureCounter , &QgsTask::taskTerminated, [ = ]() { mFeatureCounter = nullptr ; } );
709
709
710
- QgsApplication::taskManager ()->addTask ( mFeatureCounter . get () );
710
+ QgsApplication::taskManager ()->addTask ( mFeatureCounter );
711
711
}
712
712
713
713
return true ;
@@ -3899,11 +3899,14 @@ void QgsVectorLayer::onRelationsLoaded()
3899
3899
mEditFormConfig .onRelationsLoaded ();
3900
3900
}
3901
3901
3902
- void QgsVectorLayer::onSymbolsCounted ( const QHash<QString, long > &symbolFeatureCountMap )
3902
+ void QgsVectorLayer::onSymbolsCounted ()
3903
3903
{
3904
- mSymbolFeatureCountMap = symbolFeatureCountMap;
3905
- mSymbolFeatureCounted = true ;
3906
- emit symbolFeatureCountMapChanged ();
3904
+ if ( mFeatureCounter )
3905
+ {
3906
+ mSymbolFeatureCountMap = mFeatureCounter ->symbolFeatureCountMap ();
3907
+ mSymbolFeatureCounted = true ;
3908
+ emit symbolFeatureCountMapChanged ();
3909
+ }
3907
3910
}
3908
3911
3909
3912
QList<QgsRelation> QgsVectorLayer::referencingRelations ( int idx ) const
0 commit comments