Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add XmlSerializer cache to fix memory leaks. #403

Merged
merged 2 commits into from
Dec 25, 2022

Conversation

pkindruk
Copy link
Contributor

@pkindruk pkindruk commented Dec 2, 2022

Implemented 2nd option I suggested in #356

@eriove
Copy link
Contributor

eriove commented Dec 5, 2022

Not a maintainer, just an user. Would it be safer to use a ConcurrentDictionary? Before this change the write-operation was thread safe. Even though I can not really thing of a reason to save it multiple times it is an easy change to make to avoid running in to tricky bugs.

@pkindruk
Copy link
Contributor Author

pkindruk commented Dec 5, 2022

@eriove good point on thread safety, thanks.

Normally you do serialize/deserialize on UI thread since XmlLayoutSerializer uses DockingManager.Layout dependency property. However all those implementation of IXmlSerializable are public and can be invoked in custom ways, so thread safety might be needed.

@Dirkster99 Dirkster99 merged commit 972509b into Dirkster99:master Dec 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants