mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Merge pull request #1390 from commons-app/fixNearbyLeaks
Fix nearby leaks, at least some ot them
This commit is contained in:
		
						commit
						09763f942f
					
				
					 4 changed files with 48 additions and 37 deletions
				
			
		|  | @ -262,8 +262,6 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|     @Override | ||||
|     protected void onStop() { | ||||
|         super.onStop(); | ||||
|         locationManager.removeLocationListener(this); | ||||
|         locationManager.unregisterLocationManager(); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|  | @ -292,8 +290,13 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|             // to the retained fragment object to perform its own cleanup. | ||||
|             removeMapFragment(); | ||||
|             removeListFragment(); | ||||
|             unregisterReceiver(broadcastReceiver); | ||||
| 
 | ||||
|         } | ||||
|         unregisterReceiver(broadcastReceiver); | ||||
|         broadcastReceiver = null; | ||||
|         locationManager.removeLocationListener(this); | ||||
|         locationManager.unregisterLocationManager(); | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     private void addNetworkBroadcastReceiver() { | ||||
|  | @ -422,6 +425,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|         if (nearbyMapFragment != null) { | ||||
|             android.support.v4.app.FragmentManager fm = getSupportFragmentManager(); | ||||
|             fm.beginTransaction().remove(nearbyMapFragment).commit(); | ||||
|             nearbyMapFragment = null; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  | @ -433,6 +437,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp | |||
|         if (nearbyListFragment != null) { | ||||
|             android.support.v4.app.FragmentManager fm = getSupportFragmentManager(); | ||||
|             fm.beginTransaction().remove(nearbyListFragment).commit(); | ||||
|             nearbyListFragment = null; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -823,6 +823,9 @@ public class NearbyMapFragment extends DaggerFragment { | |||
|         if (mapView != null) { | ||||
|             mapView.onDestroy(); | ||||
|         } | ||||
|         selected = null; | ||||
|         currentLocationMarker = null; | ||||
| 
 | ||||
|         super.onDestroyView(); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan