Rob Shearman : winex11.drv: Empty clipboard cache on process unload to avoid false positives being reported for memory leaks .
Alexandre Julliard
julliard at winehq.org
Wed Dec 30 10:18:14 CST 2009
Module: wine
Branch: master
Commit: e4888b0e3c3ef1c7a9a36b6a7c315fee41aedd21
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e4888b0e3c3ef1c7a9a36b6a7c315fee41aedd21
Author: Rob Shearman <robertshearman at gmail.com>
Date: Tue Dec 29 19:03:40 2009 +0000
winex11.drv: Empty clipboard cache on process unload to avoid false positives being reported for memory leaks.
---
dlls/winex11.drv/clipboard.c | 10 ++++++++++
dlls/winex11.drv/x11drv.h | 1 +
dlls/winex11.drv/x11drv_main.c | 1 +
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index 706d378..f4e49e2 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -3282,3 +3282,13 @@ void X11DRV_SelectionClear( HWND hWnd, XEvent *xev )
X11DRV_CLIPBOARD_ReleaseSelection( event->display, event->selection,
event->window, hWnd, event->time );
}
+
+/***********************************************************************
+ * X11DRV_Clipboard_Cleanup
+ */
+void X11DRV_Clipboard_Cleanup(void)
+{
+ selectionAcquired = S_NOSELECTION;
+
+ X11DRV_EmptyClipboard(FALSE);
+}
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 3dd5edf..62e275d 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -765,6 +765,7 @@ extern XContext winContext;
extern void X11DRV_InitClipboard(void);
extern int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow);
+extern void X11DRV_Clipboard_Cleanup(void);
extern void X11DRV_ResetSelectionOwner(void);
extern void CDECL X11DRV_SetFocus( HWND hwnd );
extern Cursor X11DRV_GetCursor( Display *display, struct tagCURSORICONINFO *ptr );
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 3bd934b..a7f7ae0 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -583,6 +583,7 @@ static void thread_detach(void)
*/
static void process_detach(void)
{
+ X11DRV_Clipboard_Cleanup();
#ifdef SONAME_LIBXXF86VM
/* cleanup XVidMode */
X11DRV_XF86VM_Cleanup();
More information about the wine-cvs
mailing list