question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WPF memory leaks in navigation context

See original GitHub issue

Hello. If WPF MapControl is located in a navigation context (i.e. Page within a Frame or UserControl in ContentControl) and user navigates back and forth between UserControls, the Controls that contain MapControl are not getting disposed of which leads to a memory leak. This happens even if I use the master branch. Quick memory debugging showed that it is related to TimerCallback - possibly relates to https://github.com/Mapsui/Mapsui/issues/1395 . What do you think of making the WPF MapControl IDisposable?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
senchdencommented, Jan 4, 2022

@ondrasvoboda The automatic counting did not work for me, but since the Dispose method was made public, I decided to call Dispose manually. After that the leak was gone.

0reactions
pauldendulkcommented, Jun 23, 2023

This has been fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do I have a memory leak in my WPF Navigation?
Yes, according to what you've provided, you have a memory leak. When you found the references chain, and it's not in your code, ......
Read more >
Free memory when your app moves to the background
This article shows you how to reduce memory when your app moves to the background.
Read more >
A memory leak in GridControl when there is a binding ...
A memory leak in GridControl when there is a binding in the context menu ... Control + related data is hold in memory...
Read more >
Fighting Common WPF Memory Leaks with dotMemory
In this blog post, we'll see how dotMemory can help detect these common WPF memory leaks and how we can fix them. Here...
Read more >
Understanding memory leaks
Memory leaks in this context occur when dynamically allocated memory is not properly deallocated or released when it is no longer needed. #include...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found