diff --git a/fltk b/fltk index 6776f89..6ed7b56 160000 --- a/fltk +++ b/fltk @@ -1 +1 @@ -Subproject commit 6776f898724467390a04de825110e97a7098237b +Subproject commit 6ed7b56c798eea9ae36cfcc88c33235a26c9932d diff --git a/src/cfl_image.cpp b/src/cfl_image.cpp index 2c4bf8a..c7bb843 100644 --- a/src/cfl_image.cpp +++ b/src/cfl_image.cpp @@ -244,8 +244,8 @@ int Fl_Anim_GIF_Image_playing(const Fl_Anim_GIF_Image *self) { IMAGE_DEFINE(Fl_Pixmap) Fl_Pixmap *Fl_Pixmap_new(const char *const *D) { - LOCK(auto ret = new Fl_Pixmap(D)); - return ret; + LOCK(auto temp = new Fl_Pixmap(D); auto ret = temp->copy(temp->w(), temp->h()); delete temp); + return (Fl_Pixmap *)ret; } IMAGE_DEFINE(Fl_XPM_Image) diff --git a/src/cfl_tree.cpp b/src/cfl_tree.cpp index 11983b2..665a6b5 100644 --- a/src/cfl_tree.cpp +++ b/src/cfl_tree.cpp @@ -416,9 +416,7 @@ void *Fl_Tree_openicon(const Fl_Tree *self) { } void Fl_Tree_set_openicon(Fl_Tree *self, void *val) { - LOCK(auto old = self->openicon(); if (!val) self->openicon(nullptr); - else self->openicon(((Fl_Image *)val)->copy()); - ) + LOCK(self->openicon(((Fl_Image *)val)->copy())); } void *Fl_Tree_closeicon(const Fl_Tree *self) { @@ -430,9 +428,7 @@ void *Fl_Tree_closeicon(const Fl_Tree *self) { } void Fl_Tree_set_closeicon(Fl_Tree *self, void *val) { - LOCK(auto old = self->closeicon(); if (!val) self->closeicon(nullptr); - else self->closeicon(((Fl_Image *)val)->copy()); - ) + LOCK(self->closeicon(((Fl_Image *)val)->copy())); } int Fl_Tree_showcollapse(const Fl_Tree *self) {