nadako / TinkStateSharp

Handle those pesky states, now in C#
https://nadako.github.io/TinkStateSharp/
The Unlicense
40 stars 1 forks source link

Diagnostic analyzer for unused `Bind` return. #8

Closed nadako closed 1 year ago

nadako commented 1 year ago

It could be an interesting little thing to add that might help some people avoid mistakes while using this library (and also help me learn some stuff about MS codeanalysis framework):

Show a warning when Observable<T>.Bind is called but the resulting IDisposable is not used in any way. This means that there's no unsubscription and as a result could cause a memory leak

nadako commented 1 year ago

Actually this kind of warning is useful for any kind of IDisposable, so I wonder if there's already an analyzer just for that...

nadako commented 1 year ago

Yeah, this is not specific to Bind and is rather general IDisposable thing which I won't handle in this library.