public void removeDuplicateFilters ( JMessageListener listenerToCheck ) { for ( int iIndex = 0 ; ; iIndex ++ ) { BaseMessageFilter filter = listenerToCheck . getListenerMessageFilter ( iIndex ) ; if ( filter == null ) break ; if ( this . isSameFilter ( filter ) ) { if ( filter . getMessageListener ( 1 ) == null ) { // Only free if the message list is the same and only filter . removeFilterMessageListener ( listenerToCheck ) ; // DO NOT free the listener. filter . free ( ) ; // Cool, it was a dup... get rid of it. iIndex -- ; } } } }
If there is another RecordMessageFilter supplying messages to this listener remove it . This typically fixes the problem in TableModelSession where a grid listener is added for the session and then also when thin needs a listener