diff --git a/ApplicationCore.cpp b/ApplicationCore.cpp index a742e22..f0b0911 100644 --- a/ApplicationCore.cpp +++ b/ApplicationCore.cpp @@ -58,9 +58,6 @@ CApplication::~CApplication() if (FirstFunction) { - // Show Start of termination - if (Log) Log->Message( dlLow, dlLow, "%s: Terminating...", ProcessName ); - // Destroy functions while (FirstFunction) { @@ -353,8 +350,9 @@ CFunctionCore * CApplication::GetFunction( const char * Name ) } //--------------------------------------------------------------------------- -bool CApplication::Run() +bool CApplication::Run( bool TerminateOnError ) { + bool AllGood = true; TFunctionItem * FunctionItem; // Check for FD Events/States @@ -364,7 +362,16 @@ bool CApplication::Run() // Process Functions for (FunctionItem = FirstFunction; FunctionItem; FunctionItem = FunctionItem->Next ) - FunctionItem->Function->Process(); - return true; + { + if (!FunctionItem->Function->Process()) + { + if (TerminateOnError) + return false; + else { + AllGood = false; + } + } + } + return AllGood; } //--------------------------------------------------------------------------- diff --git a/ApplicationCore.h b/ApplicationCore.h index e3fd492..0702b05 100644 --- a/ApplicationCore.h +++ b/ApplicationCore.h @@ -92,7 +92,7 @@ public: CFunctionCore * GetFunction( const char * Name ); // Run Application - bool Run(); + bool Run( bool TerminateOnError ); }; //---------------------------------------------------------------------------