diff options
author | Frederic Culot <calcurse@culot.org> | 2009-06-23 08:52:07 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2009-06-23 08:52:07 +0000 |
commit | 90589eab172ee6f3dcd22cca81accca5a64d521b (patch) | |
tree | 0c2c37ef942038c425228bbad66dd811e05d8b53 /src | |
parent | 1a1dda24c383d1fd58fe461d984cfee88bb56c5e (diff) | |
download | calcurse-90589eab172ee6f3dcd22cca81accca5a64d521b.tar.gz calcurse-90589eab172ee6f3dcd22cca81accca5a64d521b.zip |
Need to remove lock only if interactive mode was launched before.
Diffstat (limited to 'src')
-rwxr-xr-x | src/utils.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/utils.c b/src/utils.c index 42c4170..4c492d9 100755 --- a/src/utils.c +++ b/src/utils.c @@ -1,4 +1,4 @@ -/* $calcurse: utils.c,v 1.70 2009/06/21 18:16:23 culot Exp $ */ +/* $calcurse: utils.c,v 1.71 2009/06/23 08:52:07 culot Exp $ */ /* * Calcurse - text-based organizer @@ -51,6 +51,8 @@ void exit_calcurse (int status) { + int remove_lock; + if (ui_mode == UI_CURSES) { notify_stop_main_thread (); @@ -58,7 +60,11 @@ exit_calcurse (int status) refresh (); endwin (); ui_mode = UI_CMDLINE; + remove_lock = 1; } + else + remove_lock = 0; + calendar_stop_date_thread (); io_stop_psave_thread (); day_free_list (); @@ -74,7 +80,9 @@ exit_calcurse (int status) notify_free_app (); keys_free (); mem_stats (); - io_unset_lock (); + if (remove_lock) + io_unset_lock (); + exit (status); } |