diff options
author | nicm <nicm> | 2017-09-22 09:04:46 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-09-22 09:04:46 +0000 |
commit | d563aa7c7b45e6fbd87fb1072579583dbaba86bc (patch) | |
tree | ada7bc83a1b97fa39a54ba87373227afdae8490a | |
parent | c86d83f835ec5c589dedb5b21f45df468fe7c875 (diff) | |
download | rtmux-d563aa7c7b45e6fbd87fb1072579583dbaba86bc.tar.gz rtmux-d563aa7c7b45e6fbd87fb1072579583dbaba86bc.tar.bz2 rtmux-d563aa7c7b45e6fbd87fb1072579583dbaba86bc.zip |
Initialize alerts timer event where it is used, avoids crash with new windows.
-rw-r--r-- | alerts.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -141,9 +141,11 @@ alerts_reset(struct window *w) { struct timeval tv; + if (!event_initialized(&w->alerts_timer)) + evtimer_set(&w->alerts_timer, alerts_timer, w); + w->flags &= ~WINDOW_SILENCE; - if (event_initialized(&w->alerts_timer)) - event_del(&w->alerts_timer); + event_del(&w->alerts_timer); timerclear(&tv); tv.tv_sec = options_get_number(w->options, "monitor-silence"); @@ -158,9 +160,6 @@ alerts_queue(struct window *w, int flags) { alerts_reset(w); - if (!event_initialized(&w->alerts_timer)) - evtimer_set(&w->alerts_timer, alerts_timer, w); - if ((w->flags & flags) != flags) { w->flags |= flags; log_debug("@%u alerts flags added %#x", w->id, flags); |