}
MEDPresentation* presentation = (*citr).second;
- presentation->activateView();
+ if (!presentation->activateView())
+ {
+ // The view has been recreated - transfer all presentations that were in the deleted view to this new one
+ int viewId = presentation->getPyViewID();
+ std::map<MEDPresentation::TypeID, MEDPresentation*>::iterator citr = _presentations.begin();
+ for (; citr != _presentations.end(); ++citr)
+ {
+ if(citr->second->getPyViewID() == viewId)
+ citr->second->recreateViewSetup();
+ }
+ }
_activeViewPythonId = presentation->getPyViewID();
STDLOG("Activated view " << _activeViewPythonId);
return true;
(*presList)[i] = it->first;
return presList;
}
+
+void
+MEDPresentationManager_i::cleanUp()
+{
+ _activeViewPythonId = -1;
+ std::map<MEDPresentation::TypeID, MEDPresentation*>::iterator it;
+ for (it = _presentations.begin(); it != _presentations.end(); ++it)
+ delete(it->second);
+ _presentations.clear();
+}