aboutsummaryrefslogtreecommitdiff
path: root/setupx.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-01-10 13:46:06 -0500
committerB. Watson <urchlay@slackware.uk>2024-01-10 13:46:06 -0500
commita47bf6ed4f186f41693e186bf107cf51ada4d5ae (patch)
tree2f0dc9e70c74b2ac2d3878e1a6442af3c2c3bd89 /setupx.c
parent4eaf25bc5394fb1f9f23403130e48c016f3a89fa (diff)
downloadhcalc-a47bf6ed4f186f41693e186bf107cf51ada4d5ae.tar.gz
Clean up memory leak when changing window size.
Diffstat (limited to 'setupx.c')
-rw-r--r--setupx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/setupx.c b/setupx.c
index 4f4f583..c103f64 100644
--- a/setupx.c
+++ b/setupx.c
@@ -92,7 +92,13 @@ void setup_x(void) {
bit_off = color.pixel;
}
-void process_input() {
+void shutdown_x(void) {
+ XDestroyWindow(display, window);
+ XFreeGC(display, gc);
+ XCloseDisplay(display);
+}
+
+void process_input(void) {
char c;
KeySym keysym;
XTextProperty tprop;