Skip to content
Permalink
Browse files

Fix segfault on exit

  • Loading branch information
nyalldawson committed Mar 26, 2019
1 parent 584290c commit c282e95d1c00619b3467c3dfe719a893e8d08e2b
Showing with 7 additions and 3 deletions.
  1. +7 −3 tests/src/python/test_qgspointdisplacementrenderer.py
@@ -28,7 +28,7 @@
import os

from qgis.PyQt.QtGui import QColor
from qgis.PyQt.QtCore import QSize
from qgis.PyQt.QtCore import QSize, QThreadPool
from qgis.PyQt.QtXml import QDomDocument

from qgis.core import (QgsVectorLayer,
@@ -87,6 +87,11 @@ def _tearDown(self, layer):
#QgsProject.instance().removeAllMapLayers()
QgsProject.instance().removeMapLayer(layer)

@classmethod
def tearDownClass(cls):
# avoid crash on finish, probably related to https://bugreports.qt.io/browse/QTBUG-35760
QThreadPool.globalInstance().waitForDone()

def _setProperties(self, r):
""" set properties for a renderer for testing with _checkProperties"""
r.setLabelAttributeName('name')
@@ -326,7 +331,7 @@ def testClusterConcentricLabelsDifferentSizes(self):
layer.renderer().setPlacement(QgsPointDisplacementRenderer.ConcentricRings)
renderchecker = QgsMultiRenderChecker()
renderchecker.setMapSettings(mapsettings)
renderchecker.setControlPathPrefix('displacement_renderer')
renderchecker.setControlPathPrefix('displacement_renderer')
renderchecker.setControlName('expected_displacement_cluster_concentric_labels_diff_size')
self.assertTrue(renderchecker.runTest('expected_displacement_cluster_concentric_labels_diff_size'))
self._tearDown(layer)
@@ -373,6 +378,5 @@ def testClusterConcentricLabelsDifferentSizesFarther(self):
self._tearDown(layer)



if __name__ == '__main__':
unittest.main()

0 comments on commit c282e95

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