From b20e32a8b60151e70d873cab3577123203e03d5f Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 16 Jul 2015 01:40:58 +0100 Subject: [PATCH] add Event::clear --- ostd/signal.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ostd/signal.hh b/ostd/signal.hh index 6e2e51a..d54a52d 100644 --- a/ostd/signal.hh +++ b/ostd/signal.hh @@ -31,9 +31,15 @@ struct Event { } ~Event() { + clear(); + } + + void clear() { for (Size i = 0; i < p_nfuncs; ++i) p_funcs[i].~Function(); delete[] (byte *)p_funcs; + p_funcs = nullptr; + p_nfuncs = 0; } template