summaryrefslogtreecommitdiff
path: root/src/common/nullpo.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-12-07 00:06:05 +0100
committerAndrei Karas <akaras@inbox.ru>2020-03-30 06:35:10 +0300
commit8f38bf7f9e402edc14df3fe89dc0b46b1b1c3ee9 (patch)
tree3fbe3311ff50b1d66a32ead39678bdda7d8b1ae4 /src/common/nullpo.h
parent80372d4ca082d6d35f89e99094544fc892cfeb75 (diff)
downloadhercules-8f38bf7f9e402edc14df3fe89dc0b46b1b1c3ee9.tar.gz
hercules-8f38bf7f9e402edc14df3fe89dc0b46b1b1c3ee9.tar.bz2
hercules-8f38bf7f9e402edc14df3fe89dc0b46b1b1c3ee9.tar.xz
hercules-8f38bf7f9e402edc14df3fe89dc0b46b1b1c3ee9.zip
Fix a memory leak caused by repeatedly allocating the libbacktrace state at every printed backtrace
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/nullpo.h')
-rw-r--r--src/common/nullpo.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/nullpo.h b/src/common/nullpo.h
index fc5386243..3eb002834 100644
--- a/src/common/nullpo.h
+++ b/src/common/nullpo.h
@@ -28,6 +28,8 @@
// if need disable asserts checks this line can be commented
#define ASSERT_CHECK
+struct backtrace_state;
+
/** Assert */
#if defined(ASSERT_CHECK)
@@ -148,7 +150,12 @@
struct nullpo_interface {
+ void (*init) (void);
+ void (*final) (void);
+
void (*assert_report) (const char *file, int line, const char *func, const char *targetname, const char *title);
+
+ struct backtrace_state *backtrace_state;
};
#ifdef HERCULES_CORE