@@ -160,23 +160,18 @@ public void dispose() {
160
160
// but seems redundant to call it here, since dispose() is triggered by
161
161
// the onDestroy() handler, which means that the app is already
162
162
// being destroyed.
163
-
164
- activity = null ;
165
163
}
166
164
167
165
if (view != null ) {
168
166
view .destroyDrawingCache ();
169
- view = null ;
170
167
}
171
168
172
169
if (component != null ) {
173
170
component .dispose ();
174
- component = null ;
175
171
}
176
172
177
173
if (surfaceView != null ) {
178
174
surfaceView .getHolder ().getSurface ().release ();
179
- surfaceView = null ;
180
175
}
181
176
}
182
177
@@ -348,15 +343,17 @@ public void setSystemUiVisibility(int visibility) {
348
343
349
344
@ Override
350
345
public void finish () {
351
- if (component == null ) return ;
352
-
353
- if (component .getKind () == AppComponent .FRAGMENT ) {
354
- activity .finish ();
355
- } else if (component .getKind () == AppComponent .WALLPAPER ) {
356
- wallpaper .stopSelf ();
357
- } else if (component .getKind () == AppComponent .WATCHFACE ) {
358
- watchface .stopSelf ();
359
- }
346
+ // No need to do anything here, as the Android system will take care of
347
+ // releasing activity resources if needed, etc.
348
+ // if (component == null) return;
349
+ //
350
+ // if (component.getKind() == AppComponent.FRAGMENT) {
351
+ // activity.finish();
352
+ // } else if (component.getKind() == AppComponent.WALLPAPER) {
353
+ // wallpaper.stopSelf();
354
+ // } else if (component.getKind() == AppComponent.WATCHFACE) {
355
+ // watchface.stopSelf();
356
+ // }
360
357
}
361
358
362
359
@@ -414,7 +411,7 @@ public boolean stopThread() {
414
411
415
412
@ Override
416
413
public boolean isStopped () {
417
- return thread == null ;
414
+ return thread == null ;
418
415
}
419
416
420
417
0 commit comments