From 522fb284876a67bfcc3e170871a2a18df3c4cb58 Mon Sep 17 00:00:00 2001 From: Devang-Android <76443293+Devang-Android@users.noreply.github.com> Date: Wed, 16 Mar 2022 02:45:15 +0530 Subject: [PATCH] disposables obj is not using .dispose() in onDestroy() Here instead of .dispose() we are just using clear() the list which actually still perform unnecessary changes. --- .../android/samples/ui/operators/IntervalExampleActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/rxjava2/android/samples/ui/operators/IntervalExampleActivity.java b/app/src/main/java/com/rxjava2/android/samples/ui/operators/IntervalExampleActivity.java index 36baeaf..389c2de 100644 --- a/app/src/main/java/com/rxjava2/android/samples/ui/operators/IntervalExampleActivity.java +++ b/app/src/main/java/com/rxjava2/android/samples/ui/operators/IntervalExampleActivity.java @@ -46,7 +46,7 @@ public void onClick(View view) { @Override protected void onDestroy() { super.onDestroy(); - disposables.clear(); // clearing it : do not emit after destroy + disposables.dispose(); //disposeing it : so it do not perform unnecessary emittion } /* @@ -93,4 +93,4 @@ public void onComplete() { } -} \ No newline at end of file +}