From: Till Theato Date: Wed, 11 Aug 2010 11:41:14 +0000 (+0000) Subject: Fix crashes in the color picker on X11 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=18c6f7c191983ef2b2c843f142586a21b95dad8d;p=kdenlive Fix crashes in the color picker on X11 svn path=/trunk/kdenlive/; revision=4703 --- diff --git a/src/colorpickerwidget.cpp b/src/colorpickerwidget.cpp index 9a4eb3aa..acd1d269 100644 --- a/src/colorpickerwidget.cpp +++ b/src/colorpickerwidget.cpp @@ -59,6 +59,7 @@ ColorPickerWidget::ColorPickerWidget(QWidget *parent) : { #ifdef Q_WS_X11 m_filter = 0; + m_image = NULL; #endif QHBoxLayout *layout = new QHBoxLayout(this); @@ -140,6 +141,7 @@ QColor ColorPickerWidget::averagePickedColor(const QPoint pos) #ifdef Q_WS_X11 XDestroyImage(m_image); + m_image = NULL; #endif if (size > 200) @@ -222,7 +224,7 @@ QColor ColorPickerWidget::grabColor(const QPoint &p, bool destroyImage) if( !qApp->desktop()->geometry().contains( p )) return QColor(); unsigned long xpixel; - if (m_image == 0) { + if (m_image == NULL) { Window root = RootWindow(QX11Info::display(), QX11Info::appScreen()); m_image = XGetImage(QX11Info::display(), root, p.x(), p.y(), 1, 1, -1, ZPixmap); xpixel = XGetPixel(m_image, 0, 0);