mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 02:25:50 +01:00
Fossil: Fix exception when support class is terminated
This commit is contained in:
parent
7fa5cd1be5
commit
7c9016b5a4
@ -464,6 +464,9 @@ public class QHybridSupport extends QHybridBaseSupport {
|
||||
public void dispose() {
|
||||
LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(commandReceiver);
|
||||
GBApplication.getContext().unregisterReceiver(globalCommandReceiver);
|
||||
if (watchAdapter != null) {
|
||||
watchAdapter.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
@ -172,4 +172,8 @@ public abstract class WatchAdapter {
|
||||
public void handleSetMenuStructure(JSONObject menuStructure) {
|
||||
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -156,6 +156,16 @@ public class FossilWatchAdapter extends WatchAdapter {
|
||||
getDeviceInfos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (timeoutLooper != null) {
|
||||
timeoutHandler.removeCallbacks(requestTimeoutRunnable);
|
||||
timeoutLooper.quit();
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
private void restartRequestTimeout(){
|
||||
if(timeoutLooper == null){
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user