Avoid possible memory leaks in case of exceptions

Change-Id: Ibadadacbe09a93e7d7a7210868c52a8fa582d427
This commit is contained in:
Takeshi Abe
2014-04-17 10:56:03 +09:00
parent 326f8dc37b
commit 6a964dcf0f
6 changed files with 29 additions and 30 deletions

View File

@@ -21,6 +21,7 @@
#include <HelpLinker.hxx>
#include <iostream>
#include <sal/main.h>
#include <boost/scoped_ptr.hpp>
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
std::vector<std::string> args;
@@ -28,9 +29,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
args.push_back(std::string(argv[i]));
try
{
HelpLinker* pHelpLinker = new HelpLinker();
boost::scoped_ptr<HelpLinker> pHelpLinker(new HelpLinker());
pHelpLinker->main( args );
delete pHelpLinker;
}
catch( const HelpProcessingException& e )
{