Some refactoring so icon properties does not get's copied

Added some hack to make valgrind silent in wallpaper code
This commit is contained in:
Sanel Zukan
2009-05-19 11:10:23 +00:00
parent 12acd9ea6c
commit ffee0edd57
6 changed files with 81 additions and 89 deletions

View File

@@ -363,6 +363,8 @@ static void create_tile(Fl_Image* orig, Fl_RGB_Image** copied, int X, int Y, int
Wallpaper::~Wallpaper() {
if(rootpmap_pixmap)
XFreePixmap(fl_display, rootpmap_pixmap);
delete stretched_alloc;
}
void Wallpaper::set_rootpmap(void) {
@@ -396,13 +398,18 @@ bool Wallpaper::load(const char* path, WallpaperState s) {
create_tile((Fl_Image*)i, &tiled, x(), y(), w(), h());
image(tiled);
} else if(s == WALLPAPER_STRETCH) {
Fl_Image* stretched;
Fl_Image* stretched = NULL;
if(i->w() == w() && i->h() == h())
stretched = i;
else {
/* valgrind reports it as possible lost, but FLTK should free it */
delete stretched_alloc;
stretched = i->copy(w(), h());
i->release();
stretched_alloc = stretched;
}
image(stretched);