1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 12:51:16 +00:00

Fixed possible crash on shutdown.

This commit is contained in:
Felix Ableitner 2015-06-17 15:02:52 +02:00
parent 5a0870d21a
commit 74c148b790

View file

@ -256,10 +256,12 @@ public class MainActivity extends SyncthingActivity
if (mLoadingDialog != null) { if (mLoadingDialog != null) {
mLoadingDialog.dismiss(); mLoadingDialog.dismiss();
} }
if (getService() != null) {
getService().unregisterOnApiChangeListener(this); getService().unregisterOnApiChangeListener(this);
getService().unregisterOnApiChangeListener(mFolderFragment); getService().unregisterOnApiChangeListener(mFolderFragment);
getService().unregisterOnApiChangeListener(mDevicesFragment); getService().unregisterOnApiChangeListener(mDevicesFragment);
} }
}
@Override @Override
public void onServiceConnected(ComponentName componentName, IBinder iBinder) { public void onServiceConnected(ComponentName componentName, IBinder iBinder) {