Fix memory leak

Signed-off-by: FluorineDog <guilin.gou@zilliz.com>
This commit is contained in:
FluorineDog 2021-03-01 11:14:51 +08:00 committed by yefu.chen
parent 24eebc5c72
commit b7a00e30e2

View File

@ -11,7 +11,7 @@
#include <iostream>
#include "EasyAssert.h"
#define BOOST_STACKTRACE_USE_BACKTRACE
// #define BOOST_STACKTRACE_USE_BACKTRACE
#include <boost/stacktrace.hpp>
#include <sstream>
@ -19,10 +19,14 @@ namespace milvus::impl {
std::string
EasyStackTrace() {
std::string output;
#ifdef BOOST_STACKTRACE_USE_BACKTRACE
auto stack_info = boost::stacktrace::stacktrace();
std::ostringstream ss;
ss << stack_info;
return ss.str();
output = std::string(ss.str());
#endif
return output;
}
void