From bc44508a10434b18ca3d231d58882995a4d6d2ad Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Sun, 21 Jun 2009 14:42:49 +0000 Subject: Free memory associated with structure used for appointments notification. --- ChangeLog | 7 +++++++ src/notify.c | 12 +++++++++++- src/notify.h | 3 ++- src/utils.c | 4 +++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6275f5..fea4542 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-21 Frederic Culot + + * src/notify.c (notify_free_app): new function + + * src/utils.c (exit_calcurse): free memory associated with + structure used for appointments notification + 2009-06-20 Frederic Culot * src/custom.c (set_confwin_attr): new function diff --git a/src/notify.c b/src/notify.c index 8eee0d5..32ea3e7 100755 --- a/src/notify.c +++ b/src/notify.c @@ -1,4 +1,4 @@ -/* $calcurse: notify.c,v 1.36 2009/01/22 18:11:57 culot Exp $ */ +/* $calcurse: notify.c,v 1.37 2009/06/21 14:42:49 culot Exp $ */ /* * Calcurse - text-based organizer @@ -112,6 +112,16 @@ notify_init_bar (void) extract_aptsfile (); } +/* + * Free memory associated with the notify_app structure. + */ +void +notify_free_app (void) +{ + if (notify_app.got_app && notify_app.txt) + mem_free (notify_app.txt); +} + /* Stop the notify-bar main thread. */ void notify_stop_main_thread (void) diff --git a/src/notify.h b/src/notify.h index 8823bb8..b2b8636 100755 --- a/src/notify.h +++ b/src/notify.h @@ -1,4 +1,4 @@ -/* $calcurse: notify.h,v 1.16 2009/01/02 22:28:54 culot Exp $ */ +/* $calcurse: notify.h,v 1.17 2009/06/21 14:42:49 culot Exp $ */ /* * Calcurse - text-based organizer @@ -55,6 +55,7 @@ struct notify_app_s int notify_bar (void); void notify_init_vars (void); void notify_init_bar (void); +void notify_free_app (void); void notify_start_main_thread (void); void notify_stop_main_thread (void); void notify_reinit_bar (void); diff --git a/src/utils.c b/src/utils.c index 6d83742..80101b9 100755 --- a/src/utils.c +++ b/src/utils.c @@ -1,4 +1,4 @@ -/* $calcurse: utils.c,v 1.68 2009/01/24 14:44:25 culot Exp $ */ +/* $calcurse: utils.c,v 1.69 2009/06/21 14:42:50 culot Exp $ */ /* * Calcurse - text-based organizer @@ -53,6 +53,7 @@ exit_calcurse (int status) { if (ui_mode == UI_CURSES) { + notify_stop_main_thread (); clear (); refresh (); endwin (); @@ -70,6 +71,7 @@ exit_calcurse (int status) recur_apoint_free_bkp (ERASE_FORCE); recur_event_free_bkp (ERASE_FORCE); todo_free_list (); + notify_free_app (); keys_free (); mem_stats (); exit (status); -- cgit v1.2.3-70-g09d2