aboutsummaryrefslogtreecommitdiff
path: root/curses.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2010-03-17 17:59:26 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-19 15:27:38 -0500
commitd7234f4d7e373a708e1df9ab565a71b71b189025 (patch)
treee4db9e84d66e448fdda3fe426fd3904eba8a5382 /curses.c
parent3b6304f706ef7eebc0b3b3f3a5093ec75448ee19 (diff)
downloadqemu-d7234f4d7e373a708e1df9ab565a71b71b189025.zip
qemu-d7234f4d7e373a708e1df9ab565a71b71b189025.tar.gz
qemu-d7234f4d7e373a708e1df9ab565a71b71b189025.tar.bz2
Convert atexit users to exit_notifier
All of these users have global state so we really don't see a benefit from exit_notifier. However, using exit_notifier means that there's one less justification for having global state in the first place. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'curses.c')
-rw-r--r--curses.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/curses.c b/curses.c
index 4b5beac..f9a983a 100644
--- a/curses.c
+++ b/curses.c
@@ -338,6 +338,7 @@ static void curses_keyboard_setup(void)
void curses_display_init(DisplayState *ds, int full_screen)
{
DisplayChangeListener *dcl;
+ static Notifier notifier = { .notify = curses_atexit };
#ifndef _WIN32
if (!isatty(1)) {
fprintf(stderr, "We need a terminal output\n");
@@ -347,7 +348,7 @@ void curses_display_init(DisplayState *ds, int full_screen)
curses_setup();
curses_keyboard_setup();
- atexit(curses_atexit);
+ exit_notifier_add(&notifier);
#ifndef _WIN32
#if defined(SIGWINCH) && defined(KEY_RESIZE)