Commit 228d8559 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Correctly free CF_DIB format, and don't free unknown GDI formats.

parent 4fa616c3
......@@ -577,38 +577,30 @@ static void X11DRV_CLIPBOARD_FreeData(LPWINE_CLIPDATA lpData)
{
TRACE("%04x\n", lpData->wFormatID);
if ((lpData->wFormatID >= CF_GDIOBJFIRST &&
lpData->wFormatID <= CF_GDIOBJLAST) ||
lpData->wFormatID == CF_BITMAP ||
lpData->wFormatID == CF_DIB ||
lpData->wFormatID == CF_PALETTE)
{
if (lpData->hData)
DeleteObject(lpData->hData);
if (!lpData->hData) return;
if ((lpData->wFormatID == CF_DIB) && lpData->drvData)
XFreePixmap(gdi_display, lpData->drvData);
}
else if (lpData->wFormatID == CF_METAFILEPICT)
switch (lpData->wFormatID)
{
if (lpData->hData)
{
case CF_BITMAP:
case CF_PALETTE:
DeleteObject(lpData->hData);
break;
case CF_DIB:
if (lpData->drvData) XFreePixmap(gdi_display, lpData->drvData);
GlobalFree(lpData->hData);
break;
case CF_METAFILEPICT:
DeleteMetaFile(((METAFILEPICT *)GlobalLock( lpData->hData ))->hMF );
GlobalFree(lpData->hData);
}
}
else if (lpData->wFormatID == CF_ENHMETAFILE)
{
if (lpData->hData)
DeleteEnhMetaFile(lpData->hData);
}
else if (lpData->wFormatID < CF_PRIVATEFIRST ||
lpData->wFormatID > CF_PRIVATELAST)
{
if (lpData->hData)
break;
case CF_ENHMETAFILE:
DeleteEnhMetaFile(lpData->hData);
break;
default:
if (lpData->wFormatID >= CF_PRIVATEFIRST && lpData->wFormatID <= CF_PRIVATELAST) break;
GlobalFree(lpData->hData);
break;
}
lpData->hData = 0;
lpData->drvData = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment