diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-11-07 14:28:20 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-11-07 14:28:20 +0100 |
| commit | 2445797e45f5e90eb5fd04c6678245e35dc72b10 (patch) | |
| tree | 355577e25fb5656fa19b8a0ded7426dad002fbc3 /src/Fl_Image_Surface.cxx | |
| parent | 20ab318875618c06985ff877e99535514f8abead (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.cxx | 5 |
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);} |
