Repository navigation
fix!: Timeline shouldn't implement IDisposable - #12176
Youssef1313 wants to merge 4 commits into
Conversation
BREAKING CHANGE: Timeline shouldn't implement `IDisposable`
| ~ColorAnimation() | ||
| { | ||
| if (disposing) | ||
| { | ||
| _animationImplementation.Dispose(); | ||
| } | ||
|
|
||
| base.Dispose(disposing); | ||
| _animationImplementation.Dispose(); | ||
| } |
There was a problem hiding this comment.
This may be incorrect, as it may call UI Thread-affine APIs on the GC's thread. It may be needed to schedule the disposable on the dispatcher, somehow.
There was a problem hiding this comment.
I was expecting that I might be doing something wrong, but I couldn't really figure out a different way.
It may be needed to schedule the disposable on the dispatcher, somehow.
Just a _ = Dispatcher.RunAsync(...)?
There was a problem hiding this comment.
Yes, it's likely better, yes.
b081627 to
3b9e59f
Compare
|
|
||
| DisposePartial(); | ||
| } | ||
| _subscriptions.Dispose(); |
There was a problem hiding this comment.
Can you dispatch from here as well?
| { | ||
| base.Dispose(disposing); | ||
|
|
||
| if (_frameScheduler != null) |
There was a problem hiding this comment.
We have the same problem here :)
| Children[i].Dispose(); | ||
| } | ||
| } | ||
| Children = null; |
There was a problem hiding this comment.
Likely here as well, as TimelineCollection is a DependencyObject
| } | ||
| } | ||
|
|
||
| protected override void Dispose(bool disposing) |
There was a problem hiding this comment.
After thinking about it, we probably should be relying on storyboard only to dispose all inner items. Let's keep the Dispose methods (but internal) and schedule only once from Storyboard. This will stress the GC less, and avoid additional circular references issues.
|
Replaced by #12201 |
BREAKING CHANGE: Timeline shouldn't implement
IDisposableGitHub Issue (If applicable): Part of #8339
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information
Internal Issue (If applicable):