diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-04-24 11:21:03 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-09 09:19:48 +1000 |
commit | 3bc449c9c411c4ede53eb6f4a24813ef065d40d9 (patch) | |
tree | 29382fb22d8360c376d4b651336d0691bfb93401 | |
parent | 2adca02d926a1dde0bc350b04494aa8b59dac54d (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>
-rw-r--r-- | Xi/extinit.c | 2 | ||||
-rw-r--r-- | Xi/xibarriers.c | 12 | ||||
-rw-r--r-- | Xi/xibarriers.h | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c index 619d0e468..13f22e0b0 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); |