From d8861f877ec1e52ff03781fa2246e7343a9387ae Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Thu, 22 Jan 2009 18:11:56 +0000 Subject: bugfix: avoid possible segfault if notify_stop_main_thread is called before thread was launched (thanks Jan for reporting this) --- src/notify.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/notify.c') diff --git a/src/notify.c b/src/notify.c index f258fb8..8eee0d5 100755 --- a/src/notify.c +++ b/src/notify.c @@ -1,4 +1,4 @@ -/* $calcurse: notify.c,v 1.35 2009/01/03 21:32:11 culot Exp $ */ +/* $calcurse: notify.c,v 1.36 2009/01/22 18:11:57 culot Exp $ */ /* * Calcurse - text-based organizer @@ -116,7 +116,8 @@ notify_init_bar (void) void notify_stop_main_thread (void) { - pthread_cancel (notify_t_main); + if (notify_t_main) + pthread_cancel (notify_t_main); } /* -- cgit v1.2.3-54-g00ecf