Skip to content

Commit 0df8476

Browse files
committed
Reduce build warnings.
1 parent 63d26a8 commit 0df8476

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/util/ralloc.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,17 @@ public: \
434434
return p; \
435435
} \
436436
\
437+
static void operator delete(void *p, void *mem_ctx) \
438+
{ \
439+
/* The object's destructor is guaranteed to have already been \
440+
* called by the delete operator at this point -- Make sure it's \
441+
* not called again. \
442+
*/ \
443+
if (!HAS_TRIVIAL_DESTRUCTOR(TYPE)) \
444+
ralloc_set_destructor(p, NULL); \
445+
ralloc_free(p); \
446+
} \
447+
\
437448
static void operator delete(void *p) \
438449
{ \
439450
/* The object's destructor is guaranteed to have already been \

0 commit comments

Comments
 (0)