diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 9e98f62b4d..52349d0e0a 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -487,7 +487,7 @@ bool wxWindowDCImpl::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const } if (image == NULL) { - *col = wxColour(); + col->UnRef(); return false; } GdkColormap* colormap = gdk_image_get_colormap(image); @@ -498,7 +498,7 @@ bool wxWindowDCImpl::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const { GdkColor c; gdk_colormap_query_color(colormap, pixel, &c); - col->Set(c.red >> 8, c.green >> 8, c.blue >> 8); + *col = wxColour(c); } g_object_unref(image); return true; @@ -2062,7 +2062,7 @@ void wxWindowDCImpl::ComputeScaleAndOrigin() // this is a bit artificial, but we need to force wxDC to think the pen // has changed wxPen pen = m_pen; - m_pen = wxNullPen; + m_pen.UnRef(); SetPen( pen ); }