public static void stopContext(Context ctx){
synchronized (activeContexts) {
    activeContexts.remove(ctx);
    if (activeContexts.isEmpty()) {
      syncDeinitialize();
    }
 else {
      if (instance != null && getActivity() != null) {
        instance.deinitialize();
      }
    }
  }
}

public static void stopContext ( Context ctx ) { synchronized ( activeContexts ) { activeContexts . remove ( ctx ) ; if ( activeContexts . isEmpty ( ) ) { syncDeinitialize ( ) ; } else { if ( instance != null && getActivity ( ) != null ) { instance . deinitialize ( ) ; } } } }
cleans up resources in the given context . this method should be called by any activity or service that called startcontext ( ) when it started .
