© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•16mo ago•
23 replies
Elio

Garbage Management wpf

Hi, I'd like to know how to manage process memory in my software. Here is some code that has a constructor with a
modalNavigationStore
modalNavigationStore
parameter, which is a singleton that I never dispose of. I'd like to know if I need to set
_modalNavigationStore = null
_modalNavigationStore = null
to ensure proper disposal and garbage collection when i'm done with my service ?
public class Service
{
    #region Fields
    protected TaskCompletionSource<DialogResult>? _dialogtcs;
    protected ModalNavigationStore _modalNavigationStore;

    #region Constructors
    public Service(ModalNavigationStore modalNavigationStore)
    {
        _modalNavigationStore = modalNavigationStore;
        _parameterNavigationService = navigationService;
    }
    #endregion
}
public class Service
{
    #region Fields
    protected TaskCompletionSource<DialogResult>? _dialogtcs;
    protected ModalNavigationStore _modalNavigationStore;

    #region Constructors
    public Service(ModalNavigationStore modalNavigationStore)
    {
        _modalNavigationStore = modalNavigationStore;
        _parameterNavigationService = navigationService;
    }
    #endregion
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ WPF UI (lepoco/wpfui) Questions
C#CC# / help
2y ago
Garbage collector
C#CC# / help
17mo ago
WPF .NET 8.0 cant find System.Management Reference
C#CC# / help
11mo ago
Best Practices for Configuration Management software development (WPF C#)
C#CC# / help
12mo ago