Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive "No reference to the subscription is kept" #11

Open
KirillGorbach opened this issue May 2, 2023 · 1 comment
Open

False positive "No reference to the subscription is kept" #11

KirillGorbach opened this issue May 2, 2023 · 1 comment

Comments

@KirillGorbach
Copy link

When I assign a variable in kotlin using if condition, the leaking subscription is falsely determined:

val subscription = if (condition) {
getMyRequestSingle().subscribe()
} else {
...
}

.subscribe() provides warning "No reference to the subscription is kept", but the subscription is not really leaking
Using version 1.7.8

@hvisser
Copy link
Contributor

hvisser commented May 3, 2023

I assume you are also returning a subscription in your else block right? It could be that this needs some specific handling. I haven't been using rxlint for a couple of years now so a PR to fix this would be welcome as I probably don't have the time for a fix at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants