diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-30 22:09:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-10-01 15:35:19 +0100 |
commit | 68b1861ace1c1dec33555d68c0a3b9279dd712c7 (patch) | |
tree | fb8b328121de1b1126089a016f805e60124eff42 /sal | |
parent | 14a03abcd32800b52e900c405673c5b864e994a6 (diff) |
easier to find leaks if the test harness doesn't leak
Diffstat (limited to 'sal')
-rw-r--r-- | sal/cppunittester/cppunittester.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index c1904b485974..f80f45013d3a 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -59,6 +59,7 @@ #include "cppunit/portability/Stream.h" #include "boost/noncopyable.hpp" +#include "boost/ptr_container/ptr_vector.hpp" namespace { @@ -172,6 +173,7 @@ SAL_IMPLEMENT_MAIN() { #endif CppUnit::TestResult result; + boost::ptr_vector<osl::Module> modules; cppunittester::LibreOfficeProtector *throw_protector = 0; std::string args; std::string testlib; @@ -199,8 +201,8 @@ SAL_IMPLEMENT_MAIN() { } rtl::OUString lib(getArgument(index + 1)); rtl::OUString sym(getArgument(index + 2)); - oslGenericFunction fn = (new osl::Module(lib, SAL_LOADMODULE_GLOBAL)) - ->getFunctionSymbol(sym); + modules.push_back(new osl::Module(lib, SAL_LOADMODULE_GLOBAL)); + oslGenericFunction fn = modules.back().getFunctionSymbol(sym); throw_protector = fn == 0 ? 0 : (*reinterpret_cast< cppunittester::ProtectorFactory * >(fn))(); |