diff --git a/src/plugins/topology/topolTest.cpp b/src/plugins/topology/topolTest.cpp index 3775846e3926..4b0fc6dda921 100644 --- a/src/plugins/topology/topolTest.cpp +++ b/src/plugins/topology/topolTest.cpp @@ -1363,8 +1363,7 @@ QgsSpatialIndex *topolTest::createIndex( QgsVectorLayer *layer, const QgsRectang if ( testCanceled() ) { - delete index; - return nullptr; + return index; } if ( f.hasGeometry() )