Closed uhfath closed 2 years ago
Fluxor implements it the way MS recommends - https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-dispose
However, I think the call to Dispose(bool)
should only be called if IsDisposed is not true. I'll put this into a future release.
How to properly override
Dispose
when inheriting fromFluxorComponent
? This is a basic pattern when usingIDisposable
:The
FluxorComponent
does just that. However,Disposed
is private so when overridden in a descendant class we have no access to it. Perhaps it should be protected or there is a better way out? Maybe return it's initial value fromprotected virtual void Dispose(bool disposing)
? In this case we could do something like this:Of course we can use our own
isDisposed
like we used to, but that seemed a bit awkward in this case.