aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2017-09-22 09:04:46 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2017-09-22 17:58:30 +0100
commit71ec616e4d8b8ccb37991913fbb1e7386dd98f6a (patch)
tree307282843856414b3dae8ad8618ae0ff169e4e80
parenta8b84b7cfa29f06346bd46a6ce1f64041f590f19 (diff)
downloadrtmux-71ec616e4d8b8ccb37991913fbb1e7386dd98f6a.tar.gz
rtmux-71ec616e4d8b8ccb37991913fbb1e7386dd98f6a.tar.bz2
rtmux-71ec616e4d8b8ccb37991913fbb1e7386dd98f6a.zip
Initialize alerts timer event where it is used, avoids crash with new windows.
-rw-r--r--alerts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/alerts.c b/alerts.c
index 32469c63..d90d0eb8 100644
--- a/alerts.c
+++ b/alerts.c
@@ -141,6 +141,9 @@ 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;
event_del(&w->alerts_timer);
@@ -157,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);