Free used X11 resources colormap, pixmap, cursor.

This commit is contained in:
Johns 2012-07-25 16:07:36 +02:00
parent 15583a79c4
commit 8b0d8d8446
2 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,7 @@
User johns
Date:
Free used X11 resources colormap, pixmap, cursor.
Fix bug: spelling USE_VAPI wrong, missing functions.
User johns

15
video.c
View File

@ -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"));