summaryrefslogtreecommitdiff
path: root/adapters
diff options
context:
space:
mode:
authorMark Nunberg <mnunberg@haskalah.org>2019-02-11 14:56:56 -0500
committerMark Nunberg <mnunberg@haskalah.org>2019-02-20 09:11:10 -0500
commitf0a7595056d00383701fcb2a6247ea1ec91c2ae9 (patch)
tree0a6a35fb33301c0987f4c44494ceba553695a34e /adapters
parent1eb44cf0c4e004dda6d8b9c7500cd55e367cc87b (diff)
libevent: call destroy from cleanup
also, indentation fix
Diffstat (limited to 'adapters')
-rw-r--r--adapters/libevent.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/adapters/libevent.h b/adapters/libevent.h
index fb5558e..1c86c15 100644
--- a/adapters/libevent.h
+++ b/adapters/libevent.h
@@ -47,7 +47,7 @@ typedef struct redisLibeventEvents {
} redisLibeventEvents;
static void redisLibeventDestroy(redisLibeventEvents *e) {
- free(e);
+ free(e);
}
static void redisLibeventHandler(int fd, short event, void *arg) {
@@ -56,8 +56,8 @@ static void redisLibeventHandler(int fd, short event, void *arg) {
e->state |= REDIS_LIBEVENT_ENTERED;
#define CHECK_DELETED() if (e->state & REDIS_LIBEVENT_DELETED) {\
- redisLibeventDestroy(e);\
- return; \
+ redisLibeventDestroy(e);\
+ return; \
}
if ((event & EV_TIMEOUT) && (e->state & REDIS_LIBEVENT_DELETED) == 0) {
@@ -122,16 +122,16 @@ static void redisLibeventDelWrite(void *privdata) {
static void redisLibeventCleanup(void *privdata) {
redisLibeventEvents *e = (redisLibeventEvents*)privdata;
if (!e) {
- return;
+ return;
}
event_del(e->ev);
event_free(e->ev);
e->ev = NULL;
if (e->state & REDIS_LIBEVENT_ENTERED) {
- e->state |= REDIS_LIBEVENT_DELETED;
+ e->state |= REDIS_LIBEVENT_DELETED;
} else {
- free(e);
+ redisLibeventDestroy(e);
}
}