summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-04-20 15:30:30 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-04-23 15:06:40 +1000
commitf8f44f42eb543ecd944a84facba6c09bf48e7711 (patch)
tree959d64b4af97f454b73cfbee467d290a057e85a2
parent2ac185d2fd2b884f4f59a7f7f61f414d139859aa (diff)
Destroy extension record after last display is removed
The extension record is currently leaked and never freed. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/XExtInt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 43738a2..27638bd 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -434,7 +434,16 @@ XInputClose(
XFree((char *)((XInputData *) info->data)->vers);
XFree((char *)info->data);
}
- return XextRemoveDisplay(xinput_info, dpy);
+
+ if (!XextRemoveDisplay(xinput_info, dpy))
+ return 0;
+
+ if (xinput_info->ndisplays == 0) {
+ XextDestroyExtension(xinput_info);
+ xinput_info = NULL;
+ }
+
+ return 1;
}
static int