From 8af8a969ea7266ecdce4cbbc89c3e505074b5286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 30 Mar 2011 12:57:21 +0200 Subject: Fixed X error in qxcbwindowsurface.cpp Don't free null GC. --- src/plugins/platforms/xcb/qxcbwindowsurface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp index 61239af..110aa10 100644 --- a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp +++ b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp @@ -120,7 +120,8 @@ void QXcbShmImage::destroy() void QXcbShmImage::put(xcb_window_t window, const QPoint &target, const QRect &source) { if (m_gc_window != window) { - Q_XCB_CALL(xcb_free_gc(xcb_connection(), m_gc)); + if (m_gc) + Q_XCB_CALL(xcb_free_gc(xcb_connection(), m_gc)); m_gc = xcb_generate_id(xcb_connection()); Q_XCB_CALL(xcb_create_gc(xcb_connection(), m_gc, window, 0, 0)); -- cgit v0.12