aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/event.h
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-06-23 02:00:19 -0400
committerDeterminant <ted.sybil@gmail.com>2019-06-23 02:00:19 -0400
commit13e2643356bfcdeffd9f6e854f07ee68f29dc23b (patch)
tree8fae57e59a8a82676ef17d321b03cf4525933b87 /include/salticidae/event.h
parentda9410b41cf56340fd4a3e5148df704c9c0e139c (diff)
get rid of `self()` and `release_self()`; fix hidden bugs
Diffstat (limited to 'include/salticidae/event.h')
-rw-r--r--include/salticidae/event.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/salticidae/event.h b/include/salticidae/event.h
index b243865..ad78a6e 100644
--- a/include/salticidae/event.h
+++ b/include/salticidae/event.h
@@ -308,6 +308,7 @@ class TimedFdEvent: public FdEvent, public TimerEvent {
void clear() {
TimerEvent::clear();
FdEvent::clear();
+ callback = nullptr;
}
using FdEvent::set_callback;
@@ -532,7 +533,7 @@ class MPSCQueueEventDriven: public MPSCQueue<T> {
fd(eventfd(0, EFD_NONBLOCK)) {
if (fd == -1) throw SalticidaeError(SALTI_ERROR_FD);
}
- ~MPSCQueueEventDriven() { close(fd); }
+ ~MPSCQueueEventDriven() { close(fd); unreg_handler(); }
template<typename Func>
void reg_handler(const EventContext &ec, Func &&func) {
@@ -587,7 +588,7 @@ class MPMCQueueEventDriven: public MPMCQueue<T> {
fd(eventfd(0, EFD_NONBLOCK)) {
if (fd == -1) throw SalticidaeError(SALTI_ERROR_FD);
}
- ~MPMCQueueEventDriven() { close(fd); }
+ ~MPMCQueueEventDriven() { close(fd); unreg_handlers(); }
// this function is *NOT* thread-safe
template<typename Func>