-
Notifications
You must be signed in to change notification settings - Fork 267
[New rule] Ensure dispose/close called #1229
Comments
@Ravensof can you elaborate on when exactly dispose is supposed to be called? Right now it's not clear at all. |
@incendial just defines in analysis_options.yaml something like
then create class
and when i create new object which is |
Called where? |
I mean there are multiple places where dispose can be called. For example, if it's a local variable and it is passed to another function, it can be disposed in two places. So it's not clear where the warning should appear. Or you mean only class fields? |
Got it, the fields. |
i dont know how its better in cases when disposable passed to another function. in one side you have to dispose object in that level where you create it.
maybe passing to another function should be counted as call |
The case with providers is also covered by another Teams rule, that will become available in few days. |
thanks, that was fast, but how to apply it to my class? it just checking method named |
Yes. After the release of 1.4.0, it will also check for 'close' and 'cancel'. |
okay, thanks again |
@Ravensof and the second part you've asked for https://dcm.dev/docs/rules/provider/dispose-providers/, covers the |
@incendial thanks, im appreciate it. it could be very useful, but we cant use teams version, i didnt even knew it exists -_-' |
What stops you from it? |
because of politics visa/master_card not working in our country. |
Is it really only one rule? |
we're feeling fine with free version. as i said we didnt knew about teams version and didnt check its benefits |
i found some useful rules for myself, but im a regular programmer and i dont feel i have a chance to suggest it for business. |
Rule details
i want to be sure that my classes canceled/disposed, like Sink`s
What type of rule is this?
Warns about a potential problem
Example code
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: