Skip to content

Commit

Permalink
fix mapcanvas memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Aug 31, 2023
1 parent 6345f19 commit c2aa30a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/map/inputmapcanvasmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ InputMapCanvasMap::InputMapCanvasMap( QQuickItem *parent )
setFlags( QQuickItem::ItemHasContents );
}

InputMapCanvasMap::~InputMapCanvasMap() = default;
InputMapCanvasMap::~InputMapCanvasMap()
{
stopRendering();
}

InputMapSettings *InputMapCanvasMap::mapSettings() const
{
Expand Down Expand Up @@ -438,9 +441,16 @@ void InputMapCanvasMap::stopRendering()
{
if ( mJob )
{
mMapUpdateTimer.stop();

disconnect( mJob, &QgsMapRendererJob::renderingLayersFinished, this, &InputMapCanvasMap::renderJobUpdated );
disconnect( mJob, &QgsMapRendererJob::finished, this, &InputMapCanvasMap::renderJobFinished );

if ( !mJob->isActive() )
mJob->deleteLater();
else
connect( mJob, &QgsMapRendererJob::finished, mJob, &QObject::deleteLater );

mJob->cancelWithoutBlocking();
mJob = nullptr;
}
Expand Down

1 comment on commit c2aa30a

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.08.453911 just submitted!

Please sign in to comment.