Skip to content

Commit

Permalink
Fixed a leak with the managed configuration change broadcast receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrudu committed Sep 6, 2022
1 parent dbab863 commit 62cab42
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ protected void onConnected()
protected void onDisconnected()
{
if (DEBUG) Log.d(TAG, "onDisconnected()");
super.onDisconnected();
unregisterManagedConfigurationChangeBroadcastReceiver();
super.onDisconnected();
}

/**********************************************************************************************/
Expand Down Expand Up @@ -154,6 +154,17 @@ private void registerManagedConfigurationChangeBroadcastReceiver()

private void unregisterManagedConfigurationChangeBroadcastReceiver()
{
unregisterReceiver(app_restrictions_changed_broadcastReceiver);
try
{
unregisterReceiver(app_restrictions_changed_broadcastReceiver);
}
catch(Exception e)
{
if(DEBUG)
{
Log.e(TAG, "Error in unregisterManagedConfigurationChangeBroadcastReceiver");
e.printStackTrace();
}
}
}
}

0 comments on commit 62cab42

Please sign in to comment.