bugfix: avoid possible segfault if notify_stop_main_thread is called before thread was launched (thanks Jan for reporting this)

This commit is contained in:
Frederic Culot
2009-01-22 18:11:56 +00:00
parent 38912b36da
commit d8861f877e
3 changed files with 13 additions and 4 deletions

View File

@@ -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);
}
/*