aboutsummaryrefslogtreecommitdiff
path: root/apps/wm.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/wm.c')
-rw-r--r--apps/wm.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/wm.c b/apps/wm.c
index 8916abf..e445528 100644
--- a/apps/wm.c
+++ b/apps/wm.c
@@ -350,10 +350,23 @@ static void handle_message(void *msg)
}
}
+static void handle_exit(void)
+{
+ if (keymap)
+ free(keymap);
+ if (windows)
+ list_destroy(windows);
+ if (screen.fb)
+ memset(screen.fb, COLOR_RED, screen.height * screen.pitch);
+}
+
int main(int argc, char **argv)
{
UNUSED(argc);
UNUSED(argv);
+
+ atexit(handle_exit);
+
assert(ioctl("/dev/fb", IO_FB_GET, &screen) == 0);
log("WM loaded: %dx%d\n", screen.width, screen.height);
wm_client = (struct client){ .pid = getpid() };
@@ -408,9 +421,5 @@ int main(int argc, char **argv)
panic("Poll/read error: %s\n", strerror(errno));
}
- // TODO: Execute?
- free(keymap);
- list_destroy(windows);
-
return 0;
}