mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
qgisapp: Ensure to properly delete 2D MapCanvasDock
When closing a 2D canvas dock, QGIS sometimes crashes. This is because when the widget helper is closed, the canvas is closed. However, some signals of the canvas widget may still be called after it is called. Hence, the crash. This issue is fixed by calling `deleteLater()` instead of `delete` to ensure a proper deletion which properly takes into account the signals.
This commit is contained in:
parent
a34442d0f3
commit
04446f9d56
@ -4786,7 +4786,7 @@ QgsMapCanvasDockWidget *QgisApp::createNewMapCanvasDock( const QString &name, bo
|
|||||||
connect( mapCanvasWidget->dockableWidgetHelper(), &QgsDockableWidgetHelper::closed, this, [ this, mapCanvasWidget]
|
connect( mapCanvasWidget->dockableWidgetHelper(), &QgsDockableWidgetHelper::closed, this, [ this, mapCanvasWidget]
|
||||||
{
|
{
|
||||||
mOpen2DMapViews.remove( mapCanvasWidget );
|
mOpen2DMapViews.remove( mapCanvasWidget );
|
||||||
delete mapCanvasWidget;
|
mapCanvasWidget->deleteLater();
|
||||||
markDirty();
|
markDirty();
|
||||||
} );
|
} );
|
||||||
connect( mapCanvasWidget, &QgsMapCanvasDockWidget::renameTriggered, this, &QgisApp::renameView );
|
connect( mapCanvasWidget, &QgsMapCanvasDockWidget::renameTriggered, this, &QgisApp::renameView );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user