// remove detached components from paintableIdMap so they
// can be GC'ed
Iterator<ClientConnector> iterator = connectorIdToConnector.values()
.iterator();
GlobalResourceHandler globalResourceHandler = uI.getSession()
.getGlobalResourceHandler(false);
while (iterator.hasNext()) {
ClientConnector connector = iterator.next();
assert connector != null;
if (connector.getUI() != uI) {
// If connector is no longer part of this uI,
// remove it from the map. If it is re-attached to the
// application at some point it will be re-added through
// registerConnector(connector)
// This code should never be called as cleanup should take place
// in detach()
getLogger()
.log(Level.WARNING,
"cleanConnectorMap unregistered connector {0}. This should have been done when the connector was detached.",
getConnectorAndParentInfo(connector));
if (globalResourceHandler != null) {
globalResourceHandler.unregisterConnector(connector);
}
uninitializedConnectors.remove(connector);
diffStates.remove(connector);
iterator.remove();
} else if (!uninitializedConnectors.contains(connector)