Skip to content

Commit 4d9d630

Browse files
committed
FIX | grpc malloc/free non-match
1 parent 72bec53 commit 4d9d630

File tree

10 files changed

+353
-169
lines changed

10 files changed

+353
-169
lines changed

include/ManapiErrors.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ namespace manapi {
258258
*/
259259
virtual void unwrap () const;
260260

261+
void stacktrace () const MANAPIHTTP_NOEXCEPT;
262+
261263
MANAPIHTTP_NODISCARD operator bool () const MANAPIHTTP_NOEXCEPT;
262264
protected:
263265
std::string_view msg_;

include/std/ManapiAsyncLogger.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ namespace manapi {
8383
static void setup_default_callback_(const std::shared_ptr<data_t> &data);
8484
template<typename ...Args>
8585
void call_(logger_type type, std::string_view service, int error_code, std::string msg, Args &&...args) {
86-
const std::size_t n = sizeof...(Args);
87-
88-
this->data->callback(type, service, error_code, n ? std::vformat(msg, std::make_format_args(args...)) : std::move(msg));
86+
if (this->data) {
87+
constexpr std::size_t n = sizeof...(Args);
88+
this->data->callback(type, service, error_code, n ? std::vformat(msg, std::make_format_args(args...)) : std::move(msg));
89+
}
8990
}
9091
std::shared_ptr<data_t> data;
9192
};

0 commit comments

Comments
 (0)