mirror of
https://github.com/boostorg/type_index.git
synced 2025-07-31 12:57:17 +02:00
Add info about the patch file to README and get rid of possible memory leak
This commit is contained in:
@ -5,3 +5,5 @@ Runtime/Compile time copyable type info. Library is waiting for boost reiew.
|
||||
Documantation available at: http://apolukhin.github.com/type_index/index.html
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
While ticket #9228 is not solved, use boost_test_no_rtti.patch to make the tests compile.
|
||||
|
@ -131,10 +131,18 @@ public:
|
||||
/// Returns user-friendly name
|
||||
std::string name_demangled() const {
|
||||
#if defined(__GNUC__)
|
||||
std::string ret;
|
||||
int status = 0 ;
|
||||
char* demang = abi::__cxa_demangle(pinfo_->name(), NULL, 0, &status);
|
||||
BOOST_ASSERT(!status);
|
||||
std::string ret(demang);
|
||||
|
||||
BOOST_TRY {
|
||||
ret = demang; // may throw out of memory exception
|
||||
} BOOST_CATCH (...) {
|
||||
free(demang);
|
||||
BOOST_RETHROW;
|
||||
} BOOST_CATCH_END
|
||||
|
||||
free(demang);
|
||||
return ret;
|
||||
#else
|
||||
|
Reference in New Issue
Block a user