summaryrefslogtreecommitdiff
path: root/src/Fl_Image_Surface.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-11-07 14:28:20 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-11-07 14:28:20 +0100
commit2445797e45f5e90eb5fd04c6678245e35dc72b10 (patch)
tree355577e25fb5656fa19b8a0ded7426dad002fbc3 /src/Fl_Image_Surface.cxx
parent20ab318875618c06985ff877e99535514f8abead (diff)
Reorganise use of virtual member function Fl_Surface_Device::end_current()
Diffstat (limited to 'src/Fl_Image_Surface.cxx')
-rw-r--r--src/Fl_Image_Surface.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx
index f58949c19..e0c5fe1fc 100644
--- a/src/Fl_Image_Surface.cxx
+++ b/src/Fl_Image_Surface.cxx
@@ -42,7 +42,10 @@ Fl_Image_Surface::Fl_Image_Surface(int w, int h, int high_res, Fl_Offscreen off)
/** The destructor. */
-Fl_Image_Surface::~Fl_Image_Surface() { delete platform_surface; }
+Fl_Image_Surface::~Fl_Image_Surface() {
+ if (is_current()) platform_surface->end_current();
+ delete platform_surface;
+}
void Fl_Image_Surface::origin(int x, int y) {platform_surface->origin(x, y);}