C#C
C#14mo ago
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 parameter, which is a singleton that I never dispose of. I'd like to know if I need to set _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
}
Was this page helpful?