diff options
Diffstat (limited to 'src/Fl_x.cxx')
| -rw-r--r-- | src/Fl_x.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index e5c970b0a..5b7e2a731 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2707,6 +2707,11 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count, const Fl_RGB_Image *image; image = icons[i]; + bool need_delete = false; + if (image->w() != image->data_w() || image->h() != image->data_h()) { + image = (Fl_RGB_Image*)image->copy(); + need_delete = true; + } data[0] = image->data_w(); data[1] = image->data_h(); @@ -2736,6 +2741,7 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count, } in += extra_data; } + if (need_delete) delete image; } } |
