anakic / Jot

Jot is a library for persisting and applying .NET application state.
http://www.codeproject.com/Articles/475498/Easier-NET-settings
MIT License
633 stars 56 forks source link

Jot holds on to form (and form data) references after the form is closed. #68

Open mcattle opened 2 months ago

mcattle commented 2 months ago

I've found that when using Jot to track a WinForm, after the form is closed and the settings are persisted, Jot still contains a reference to the form, preventing the memory from being freed up. This becomes an issue when the form loads a lot of data, as that data also continues to remain in memory after the form is closed. Fortunately it's not additive, in that re-opening the form and loading new data will release the previous reference held by Jot.

Ideally, once the form is closed and the settings are persisted, the Tracker should internally call .StopTracking() on that form.

We do have our tracker configured to use .StopTrackingOn(nameof(Form.FormClosed)), but this doesn't appear to work.