mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 10:35: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() {
|
public void dispose() {
|
||||||
LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(commandReceiver);
|
LocalBroadcastManager.getInstance(getContext()).unregisterReceiver(commandReceiver);
|
||||||
GBApplication.getContext().unregisterReceiver(globalCommandReceiver);
|
GBApplication.getContext().unregisterReceiver(globalCommandReceiver);
|
||||||
|
if (watchAdapter != null) {
|
||||||
|
watchAdapter.dispose();
|
||||||
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,4 +172,8 @@ public abstract class WatchAdapter {
|
|||||||
public void handleSetMenuStructure(JSONObject menuStructure) {
|
public void handleSetMenuStructure(JSONObject menuStructure) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,16 @@ public class FossilWatchAdapter extends WatchAdapter {
|
|||||||
getDeviceInfos();
|
getDeviceInfos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose() {
|
||||||
|
if (timeoutLooper != null) {
|
||||||
|
timeoutHandler.removeCallbacks(requestTimeoutRunnable);
|
||||||
|
timeoutLooper.quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
private void restartRequestTimeout(){
|
private void restartRequestTimeout(){
|
||||||
if(timeoutLooper == null){
|
if(timeoutLooper == null){
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user