diff options
-rw-r--r-- | libglusterfs/src/timer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c index cc47db3b9e1..0d845cdeb38 100644 --- a/libglusterfs/src/timer.c +++ b/libglusterfs/src/timer.c @@ -176,12 +176,16 @@ gf_timer_proc (void *ctx) } pthread_mutex_unlock (®->lock); if (need_cbk) { + old_THIS = NULL; if (event->xl) { old_THIS = THIS; THIS = event->xl; } event->callbk (event->data); - if (event->xl) { + /*This callbk above would have freed the event + * by calling timer_cancel, don't ever touch it + * again*/ + if (old_THIS) { THIS = old_THIS; } } |