From 8b0d8d84463b22a4183a567aaa300f30bc2a2815 Mon Sep 17 00:00:00 2001 From: Johns Date: Wed, 25 Jul 2012 16:07:36 +0200 Subject: [PATCH] Free used X11 resources colormap, pixmap, cursor. --- ChangeLog | 1 + video.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2ae6f09..718d45b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ User johns Date: + Free used X11 resources colormap, pixmap, cursor. Fix bug: spelling USE_VAPI wrong, missing functions. User johns diff --git a/video.c b/video.c index 1f54bf5..8aa1982 100644 --- a/video.c +++ b/video.c @@ -286,6 +286,7 @@ static xcb_colormap_t VideoColormap; ///< video colormap static xcb_window_t VideoWindow; ///< video window static xcb_screen_t const *VideoScreen; ///< video screen static uint32_t VideoBlankTick; ///< blank cursor timer +static xcb_pixmap_t VideoCursorPixmap; ///< blank curosr pixmap static xcb_cursor_t VideoBlankCursor; ///< empty invisible cursor static int VideoWindowX; ///< video output window x coordinate @@ -9917,9 +9918,9 @@ static void VideoCreateWindow(xcb_window_t parent, xcb_visualid_t visual, values[0] = cursor; xcb_change_window_attributes(Connection, VideoWindow, XCB_CW_CURSOR, values); + VideoCursorPixmap = pixmap; VideoBlankCursor = cursor; VideoBlankTick = 0; - // FIXME: free cursor/pixmap needed? } /// @@ -10448,6 +10449,18 @@ void VideoExit(void) xcb_destroy_window(Connection, VideoWindow); VideoWindow = XCB_NONE; } + if (VideoColormap != XCB_NONE) { + xcb_free_colormap(Connection, VideoColormap); + VideoColormap = XCB_NONE; + } + if (VideoBlankCursor != XCB_NONE) { + xcb_free_cursor(Connection, VideoBlankCursor); + VideoBlankCursor = XCB_NONE; + } + if (VideoCursorPixmap != XCB_NONE) { + xcb_free_pixmap(Connection, VideoCursorPixmap); + VideoCursorPixmap = XCB_NONE; + } if (XlibDisplay) { if (XCloseDisplay(XlibDisplay)) { Error(_("video: error closing display\n"));