double freeze
#11074
Replies: 1 comment 2 replies
-
My reading of the documentation agrees with yours in that a frozen object should be usable across threads. I would expect |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Freezable.FreezeCore loops over all the values of dependencyproperties stored in the object, and freezes the values that are Freezable. Should it not check if they are already frozen and call freeze only if they are not?
I stumbled upon this while freezing an imagebrush whose imagesource had already been frozen, on another thread. I had understood that a frozen imagesource can be used on different threads so I thought there shouldn't be a problem. But freezing the imagebrush will try to freeze again the imagesource, which immediately throws an execption because we're not on the right thread.
You may say I'm looking for trouble with my multithreading, but even on a single thread, there would be a double freeze which I imagine is not ideal or could even cause issues.
Beta Was this translation helpful? Give feedback.
All reactions