summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-24 14:59:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-07 09:41:19 +1000
commit6993f8b459e25b1a7a0a03e209688a28ce6c2c56 (patch)
treea075292cd89f37a995cda0b57642367b2a110241
parent042c6d861f7bb7038ddcdd6b59766fd9094d0e52 (diff)
Xi: free barrier code at reset time
==29423== 16 bytes in 1 blocks are definitely lost in loss record 73 of 328 ==29423== at 0x4A06B6F: calloc (vg_replace_malloc.c:593) ==29423== by 0x5987C0: XIBarrierInit (xibarriers.c:908) ==29423== by 0x58F370: XInputExtensionInit (extinit.c:1300) ==29423== by 0x4F33C3: InitExtensions (miinitext.c:337) ==29423== by 0x4997DB: main (main.c:208) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--Xi/extinit.c2
-rw-r--r--Xi/xibarriers.c12
-rw-r--r--Xi/xibarriers.h4
3 files changed, 16 insertions, 2 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 02fffe574..a49a42152 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -1171,6 +1171,8 @@ IResetProc(ExtensionEntry * unused)
free(xi_all_devices.name);
free(xi_all_master_devices.name);
+
+ XIBarrierReset();
}
/***********************************************************************
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index fccab8615..6732ce9dc 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -917,3 +917,15 @@ XIBarrierInit(void)
return PointerBarrierType;
}
+
+void
+XIBarrierReset(void)
+{
+ int i;
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ BarrierScreenPtr cs = GetBarrierScreen(pScreen);
+ free(cs);
+ SetBarrierScreen(pScreen, NULL);
+ }
+}
diff --git a/Xi/xibarriers.h b/Xi/xibarriers.h
index 11e84ec9f..f61b48214 100644
--- a/Xi/xibarriers.h
+++ b/Xi/xibarriers.h
@@ -36,8 +36,8 @@ int
XIDestroyPointerBarrier(ClientPtr client,
xXFixesDestroyPointerBarrierReq * stuff);
-Bool
-XIBarrierInit(void);
+Bool XIBarrierInit(void);
+void XIBarrierReset(void);
int SProcXIBarrierReleasePointer(ClientPtr client);
int ProcXIBarrierReleasePointer(ClientPtr client);