aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2006-06-10 20:23:00 (GMT)
committerfluxgen <fluxgen>2006-06-10 20:23:00 (GMT)
commit2fdc6ab808d3828cba1bacaff536d607dfa60c58 (patch)
tree4c3722392e720e186a918e7daede77a77eede671 /src/FbTk
parent7906f1be1772c01d86e0ca647c82fd8cf270933d (diff)
downloadfluxbox-2fdc6ab808d3828cba1bacaff536d607dfa60c58.zip
fluxbox-2fdc6ab808d3828cba1bacaff536d607dfa60c58.tar.bz2
dont free old color until we have a valid new color
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Color.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/FbTk/Color.cc b/src/FbTk/Color.cc
index f8dfe3a..9e3868e 100644
--- a/src/FbTk/Color.cc
+++ b/src/FbTk/Color.cc
@@ -116,7 +116,7 @@ bool Color::validColorString(const char *color_string, int screen) {
116 return XParseColor(disp, colm, color_string_tmp.c_str(), &color) != 0; 116 return XParseColor(disp, colm, color_string_tmp.c_str(), &color) != 0;
117} 117}
118 118
119Color &Color::operator = (const Color &col_copy) { 119Color &Color::operator = (const Color &col_copy) {
120 // check for aliasing 120 // check for aliasing
121 if (this == &col_copy) 121 if (this == &col_copy)
122 return *this; 122 return *this;
@@ -144,8 +144,6 @@ void Color::copy(const Color &col_copy) {
144 setPixel(col_copy.pixel()); 144 setPixel(col_copy.pixel());
145 return; 145 return;
146 } 146 }
147
148 free();
149 147
150 allocate(col_copy.red()*0xFF, 148 allocate(col_copy.red()*0xFF,
151 col_copy.green()*0xFF, 149 col_copy.green()*0xFF,
@@ -168,6 +166,7 @@ void Color::allocate(unsigned short red, unsigned short green, unsigned short bl
168 _FB_USES_NLS; 166 _FB_USES_NLS;
169 cerr<<"FbTk::Color: "<<_FBTKTEXT(Error, ColorAllocation, "Allocation error.", "XAllocColor failed...")<<endl; 167 cerr<<"FbTk::Color: "<<_FBTKTEXT(Error, ColorAllocation, "Allocation error.", "XAllocColor failed...")<<endl;
170 } else { 168 } else {
169 free();
171 setRGB(maxValue(color.red), 170 setRGB(maxValue(color.red),
172 maxValue(color.green), 171 maxValue(color.green),
173 maxValue(color.blue)); 172 maxValue(color.blue));