Commit 15653343 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Cursor.c: use SAFE_XFree

parent d0a6c98c
...@@ -61,6 +61,7 @@ is" without express or implied warranty. ...@@ -61,6 +61,7 @@ is" without express or implied warranty.
#include "Events.h" #include "Events.h"
#include "Render.h" #include "Render.h"
#include "Client.h" #include "Client.h"
#include "Utils.h"
#include "windowstr.h" #include "windowstr.h"
#include "resource.h" #include "resource.h"
...@@ -211,7 +212,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -211,7 +212,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
XPutImage(nxagentDisplay, source, nxagentBitmapGC, image, XPutImage(nxagentDisplay, source, nxagentBitmapGC, image,
0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height); 0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
XFree(image); SAFE_XFree(image);
image = XCreateImage(nxagentDisplay, image = XCreateImage(nxagentDisplay,
nxagentDefaultVisual(pScreen), nxagentDefaultVisual(pScreen),
...@@ -229,7 +230,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -229,7 +230,7 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
XPutImage(nxagentDisplay, mask, nxagentBitmapGC, image, XPutImage(nxagentDisplay, mask, nxagentBitmapGC, image,
0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height); 0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height);
XFree(image); SAFE_XFree(image);
fg_color.red = pCursor->foreRed; fg_color.red = pCursor->foreRed;
fg_color.green = pCursor->foreGreen; fg_color.green = pCursor->foreGreen;
...@@ -264,14 +265,12 @@ Bool nxagentUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -264,14 +265,12 @@ Bool nxagentUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
if (nxagentCursorUsesRender(pCursor, pScreen)) if (nxagentCursorUsesRender(pCursor, pScreen))
{ {
PicturePtr pPicture = nxagentCursorPicture(pCursor, pScreen); PicturePtr pPicture = nxagentCursorPicture(pCursor, pScreen);
FreePicture(pPicture, pPicture -> id); FreePicture(pPicture, pPicture -> id);
} }
if (nxagentCursor(pCursor, pScreen) != None) if (nxagentCursor(pCursor, pScreen) != None)
{ {
XFreeCursor(nxagentDisplay, nxagentCursor(pCursor, pScreen)); XFreeCursor(nxagentDisplay, nxagentCursor(pCursor, pScreen));
nxagentCursor(pCursor, pScreen) = None; nxagentCursor(pCursor, pScreen) = None;
} }
......
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