Permalink
Browse files

fixed GH #141: Application::run() documentation/implementation discre…

…pancy
  • Loading branch information...
1 parent 5a8defd commit dbe5a37106f6b860deb4eabeb6dc2d5fe95bf786 @aleks-f aleks-f committed Mar 30, 2013
Showing with 7 additions and 4 deletions.
  1. +3 −2 Util/include/Poco/Util/Application.h
  2. +4 −2 Util/src/Application.cpp
@@ -239,14 +239,15 @@ class Util_API Application: public Subsystem
/// not been registered.
virtual int run();
- /// Runs the application by performing additional initializations
+ /// Runs the application by performing additional (un)initializations
/// and calling the main() method.
///
/// First calls initialize(), then calls main(), and
/// finally calls uninitialize(). The latter will be called
/// even if main() throws an exception. If initialize() throws
/// an exception, main() will not be called and the exception
- /// will be propagated to the caller.
+ /// will be propagated to the caller. If uninitialize() throws
+ /// an exception, the exception will be propagated to the caller.
std::string commandName() const;
/// Returns the command name used to invoke the application.
View
@@ -318,12 +318,12 @@ void Application::stopOptionsProcessing()
int Application::run()
{
int rc = EXIT_CONFIG;
+ initialize(*this);
+
try
{
- initialize(*this);
rc = EXIT_SOFTWARE;
rc = main(_unprocessedArgs);
- uninitialize();
}
catch (Poco::Exception& exc)
{
@@ -337,6 +337,8 @@ int Application::run()
{
logger().fatal("system exception");
}
+
+ uninitialize();
return rc;
}

0 comments on commit dbe5a37

Please sign in to comment.