From e4888b0e3c3ef1c7a9a36b6a7c315fee41aedd21 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Tue, 29 Dec 2009 19:03:40 +0000 Subject: [PATCH] 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(+) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 706d378e675..f4e49e20e15 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 3dd5edf3e34..62e275d5421 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 3bd934b3e06..a7f7ae0915f 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(); -- 2.11.4.GIT