From 786eef6e39d58c590143d02f30e9949b40af1a24 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Fri, 17 Sep 2010 23:26:56 +0200 Subject: bugfix: forgot to resize 'pixels' before putting values into it (facepalm) --- src/FbTk/ImageControl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc index 19d8793..13d6ec3 100644 --- a/src/FbTk/ImageControl.cc +++ b/src/FbTk/ImageControl.cc @@ -203,12 +203,12 @@ ImageControl::~ImageControl() { Display *disp = FbTk::App::instance()->display(); if (!m_colors.empty()) { - std::vector pixels; + std::vector pixels(m_colors.size()); for (unsigned int i = 0; i < m_colors.size(); i++) pixels[i] = m_colors[i].pixel; - XFreeColors(disp, m_colormap, &pixels[0], m_colors.size(), 0); + XFreeColors(disp, m_colormap, &pixels[0], pixels.size(), 0); } if (!cache.empty()) { -- cgit v0.11.2