summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEarle F. Philhower III <earle@ziplabel.com>2004-04-28 01:20:05 +0000
committerEarle F. Philhower III <earle@ziplabel.com>2004-04-28 01:20:05 +0000
commitdd56920e659c4e4fd7591b877b7badc0b5c35d55 (patch)
tree3f7eca6f52767c8e252a5efb2ff36cd3bdca1bdf /hw
parent596ca4e7e6cadca299214dc3396ce5c6f6d0fccc (diff)
Always free the bitmaps from GetIconInfo
Diffstat (limited to 'hw')
-rw-r--r--hw/xwin/wincursor.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index e105c58fd..b68acc273 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -372,27 +372,27 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
winW32Error(2, GetLastError(), "winLoadCursor - CreateIconIndirect failed: %s\n");
else
{
- GetIconInfo(hCursor, &ii);
- if (ii.fIcon)
+ if (GetIconInfo(hCursor, &ii))
{
- WIN_DEBUG_MSG("winLoadCursor: CreateIconIndirect returned no cursor. Trying again.\n");
-
- DestroyCursor(hCursor);
-
- ii.fIcon = FALSE;
- ii.xHotspot = pCursor->bits->xhot;
- ii.yHotspot = pCursor->bits->yhot;
- hCursor = (HCURSOR) CreateIconIndirect( &ii );
-
- if (hCursor == NULL)
- winW32Error(2, GetLastError(), "winLoadCursor - CreateIconIndirect failed: %s\n");
-
+ if (ii.fIcon)
+ {
+ WIN_DEBUG_MSG("winLoadCursor: CreateIconIndirect returned no cursor. Trying again.\n");
+
+ DestroyCursor(hCursor);
+
+ ii.fIcon = FALSE;
+ ii.xHotspot = pCursor->bits->xhot;
+ ii.yHotspot = pCursor->bits->yhot;
+ hCursor = (HCURSOR) CreateIconIndirect( &ii );
+
+ if (hCursor == NULL)
+ winW32Error(2, GetLastError(), "winLoadCursor - CreateIconIndirect failed: %s\n");
+ }
/* GetIconInfo creates new bitmaps. Destroy them again */
if (ii.hbmMask)
DeleteObject(ii.hbmMask);
if (ii.hbmColor)
DeleteObject(ii.hbmColor);
-
}
}
}