Open pauldendulk opened 11 months ago
I am still interested in a reaction to this question. It looks like the attribute option would help, but that PR is from 2018. What are people using in the mean time? Is there another tool that I should use? I feel like I am missing something. Where is all the fun?
I have a request for advise in a specific situation.
In our library we have a cache with a GetOrCreate method. This is not an uncommon patterns, see, for instance, MemoryCache.GetOrCreateAsync.
The IDisposableAnalyzer warns that the caller should Dispose (Warning IDISP001 Dispose created), but since it is a cache we want to reuse the object later. The cache itself should call Dispose() in a cleanup routine.
This is our method
CreateSkPaint is a function that is called inside the GetOrCreatePaint method. Turning it into a lambda did not help. Is there another way we could organize our code to circumvent the warning?