dont free old color until we have a valid new color
This commit is contained in:
parent
7906f1be17
commit
2fdc6ab808
1 changed files with 2 additions and 3 deletions
|
@ -145,8 +145,6 @@ void Color::copy(const Color &col_copy) {
|
|||
return;
|
||||
}
|
||||
|
||||
free();
|
||||
|
||||
allocate(col_copy.red()*0xFF,
|
||||
col_copy.green()*0xFF,
|
||||
col_copy.blue()*0xFF,
|
||||
|
@ -168,6 +166,7 @@ void Color::allocate(unsigned short red, unsigned short green, unsigned short bl
|
|||
_FB_USES_NLS;
|
||||
cerr<<"FbTk::Color: "<<_FBTKTEXT(Error, ColorAllocation, "Allocation error.", "XAllocColor failed...")<<endl;
|
||||
} else {
|
||||
free();
|
||||
setRGB(maxValue(color.red),
|
||||
maxValue(color.green),
|
||||
maxValue(color.blue));
|
||||
|
|
Loading…
Reference in a new issue