Map<String, ViewInstanceEntity> instanceDefinitions = viewInstanceDefinitions.get(definition);
if (instanceDefinitions != null) {
ViewInstanceEntity instanceDefinition = instanceDefinitions.get(instanceName);
if (instanceDefinition != null) {
View view = definition.getView();
if (view != null) {
view.onDestroy(instanceDefinition);
}
instanceDefinitions.remove(instanceName);
}
}
}