@ Override public void removeBackgroundExceptionListener ( final OBackgroundExceptionListener listener ) { final List < WeakReference < OBackgroundExceptionListener > > itemsToRemove = new ArrayList <> ( 1 ) ; for ( final WeakReference < OBackgroundExceptionListener > ref : backgroundExceptionListeners ) { final OBackgroundExceptionListener l = ref . get ( ) ; if ( l != null && l . equals ( listener ) ) { itemsToRemove . add ( ref ) ; } } backgroundExceptionListeners . removeAll ( itemsToRemove ) ; }
Removes listener which is triggered if exception is cast inside background flush data thread .