Cysharp / R3

The new future of dotnet/reactive and UniRx.
MIT License
2.22k stars 95 forks source link

Subject etc. should implement virtual Dispose pattern #253

Closed OpenEnergyGroup closed 1 month ago

OpenEnergyGroup commented 2 months ago

Hi, the Dispose pattern of Subject does not implement

protected virtual void Dispose(bool disposing){
...
}

it's instead

   public void Dispose(bool callOnCompleted)

which makes it impossible to inherit from Subject with a class that needs to call its own Dispose before the base. The canonical Microsoft solution examples are here .

Thank you!

neuecc commented 2 months ago

Subject is not designed to be inherited, if it is misleading as such, it should be sealed.