Attempt to close all UpdateSession after catching an exception.

* New: In Hurricane::UpdateSession, added "reset()" static function to
   close all the currently opened sessions.
* New: In Hurricane::ExceptionWidget::catchAllwrapper(), close all
    pending UpdateSession if the user choose to resume.
This commit is contained in:
Jean-Paul Chaput 2016-09-10 11:13:52 +02:00
parent 6562792e53
commit d8fc626678
3 changed files with 14 additions and 0 deletions

View File

@ -209,6 +209,16 @@ void UpdateSession::close()
cdebug_log(18,0) << "UpdateSession::close() - Materialization completed." << endl;
}
void UpdateSession::reset()
// ************************
{
cdebug_log(18,1) << "UpdateSession::reset()" << endl;
while ( UPDATOR_STACK and not UPDATOR_STACK->empty() ) close();
cdebug_tabw(18,-1);
}
} // End of Hurricane namespace.

View File

@ -74,6 +74,7 @@ class UpdateSession : public SharedProperty {
public: static void open();
public: static void close();
public: static void reset();
};

View File

@ -32,6 +32,7 @@
#include "hurricane/Error.h"
#include "hurricane/Exception.h"
#include "hurricane/TextTranslator.h"
#include "hurricane/UpdateSession.h"
#include "hurricane/viewer/Graphics.h"
#include "hurricane/viewer/ExceptionWidget.h"
@ -97,6 +98,8 @@ namespace Hurricane {
ExceptionWidget::run( message );
}
if (failure) UpdateSession::reset();
return failure;
}