[PATCH 4/5] winex11: Release memory on xrandr cleanup.

Henri Verbeet hverbeet at codeweavers.com
Thu Jul 12 06:44:24 CDT 2012


---
 dlls/winex11.drv/x11drv.h      |    1 +
 dlls/winex11.drv/x11drv_main.c |    1 +
 dlls/winex11.drv/xrandr.c      |   10 ++++++++++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 9ce0bbd..e7d1281 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -665,6 +665,7 @@ struct x11drv_mode_info *X11DRV_Settings_SetHandlers(const char *name,
 void X11DRV_XF86VM_Init(void) DECLSPEC_HIDDEN;
 void X11DRV_XF86VM_Cleanup(void) DECLSPEC_HIDDEN;
 void X11DRV_XRandR_Init(void) DECLSPEC_HIDDEN;
+void X11DRV_XRandR_Cleanup(void) DECLSPEC_HIDDEN;
 
 /* XIM support */
 extern BOOL X11DRV_InitXIM( const char *input_style ) DECLSPEC_HIDDEN;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 8012df3..be2e436 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -619,6 +619,7 @@ static void thread_detach(void)
 static void process_detach(void)
 {
     X11DRV_Clipboard_Cleanup();
+    X11DRV_XRandR_Cleanup();
     /* cleanup XVidMode */
     X11DRV_XF86VM_Cleanup();
     X11DRV_XRender_Finalize();
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
index 83137a4..a8dccd4 100644
--- a/dlls/winex11.drv/xrandr.c
+++ b/dlls/winex11.drv/xrandr.c
@@ -289,6 +289,12 @@ done:
     wine_tsx11_unlock();
 }
 
+void X11DRV_XRandR_Cleanup(void)
+{
+    HeapFree( GetProcessHeap(), 0, real_xrandr_rates_count );
+    HeapFree( GetProcessHeap(), 0, real_xrandr_rates );
+}
+
 #else /* SONAME_LIBXRANDR */
 
 void X11DRV_XRandR_Init(void)
@@ -296,4 +302,8 @@ void X11DRV_XRandR_Init(void)
     TRACE("XRandR support not compiled in.\n");
 }
 
+void X11DRV_XRandR_Cleanup(void)
+{
+}
+
 #endif /* SONAME_LIBXRANDR */
-- 
1.7.8.6




More information about the wine-patches mailing list