Answer Overflow Logo
Change Theme
Search Answer Overflow
GitHub
Add Your Server
Login
Home
Popular
Topics
Gaming
Programming
Jaiganésh
Posts
Comments
C
C#
•
Created by Ossie on 8/22/2023 in
#help
❔ Minimizing WPF app to system tray?
WPF has no notification area API, so you should either use the WinForms API or the Win32 API directly.
4 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
You could click on the objects and see if an instance of Background is still there.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
And then you can try hitting collect or snapshot (don't remember the name exactly).
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
At the bottom you should see a memory usage tab.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
The memory usage window in the Visual Studio debugger can show all the managed objects not collected yet.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
Try calling GC.Collect and check if it's gone.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
If it still leaks after the GC runs, then probably you have a reference to it somewhere that you aren't realising.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
A GC doesn't immediately delete after it's no longer used like a RAII smart pointer does.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
Not a good idea generally but could try forcing a garbage collection immediately by calling GC.Collect to check if it does get deleted.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
Also note that the old one won't get deleted immediately when you set bg = new(), it will get deleted when the GC runs the next time.
36 replies
C
C#
•
Created by Sound on 5/22/2023 in
#help
✅ Memory leaks and idk how to solve them
Does
bg
have other references?
36 replies