diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-05-25 11:59:16 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2019-05-25 11:59:16 +0200 |
| commit | 0d3a37439625e60cf247228412007fabd04ad289 (patch) | |
| tree | 8eac87f1d763dbea5e68ed869a85f9c25217e447 /FL | |
| parent | bf50352afe8c8aee3cfe1779474d6b6c1854f56f (diff) | |
Call virtual member Fl_Surface_Device::end_current() when necessary
Rename member function Fl_Surface_Device::end_current_() to end_current(),
set it protected, and make it called by the destructor of all classes
derived from Fl_Surface_Device that re-implement end_current().
This way, end_current() runs equally if Fl_Surface_Device()::pop_current()
is called before or after the drawing surface is deleted.
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Device.H | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/FL/Fl_Device.H b/FL/Fl_Device.H index b017e17f3..3a31a49b7 100644 --- a/FL/Fl_Device.H +++ b/FL/Fl_Device.H @@ -70,10 +70,10 @@ class FL_EXPORT Fl_Surface_Device { Fl_Graphics_Driver *pGraphicsDriver; static Fl_Surface_Device *surface_; // the surface that currently receives graphics requests static Fl_Surface_Device *default_surface(); // create surface if none exists yet +protected: /* Some drawing surfaces (e.g., Fl_XXX_Image_Surface_Driver) re-implement this. Gets called each time a surface ceases to be the current drawing surface. */ - virtual void end_current_() {} -protected: + virtual void end_current() {} /** Constructor that sets the graphics driver to use for the created surface. */ Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {pGraphicsDriver = graphics_driver; } /** Sets the graphics driver of this drawing surface. */ |
