From f6678514524c062e8ea62983d45110ca60842270 Mon Sep 17 00:00:00 2001 From: Mohammed Alyousef Date: Wed, 10 Jul 2024 09:13:25 +0300 Subject: [PATCH] avoid unnecessary alloc for pixmap --- src/cfl_image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cfl_image.cpp b/src/cfl_image.cpp index c7bb843..c33ecca 100644 --- a/src/cfl_image.cpp +++ b/src/cfl_image.cpp @@ -244,7 +244,7 @@ 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 temp = new Fl_Pixmap(D); auto ret = temp->copy(temp->w(), temp->h()); delete temp); + LOCK(Fl_Pixmap temp(D); auto ret = temp.copy(temp.w(), temp.h())); return (Fl_Pixmap *)ret; }