From 0d3a37439625e60cf247228412007fabd04ad289 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 25 May 2019 11:59:16 +0200 Subject: 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. --- src/Fl_Device.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Fl_Device.cxx') diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx index db632d74c..98d8928a1 100644 --- a/src/Fl_Device.cxx +++ b/src/Fl_Device.cxx @@ -63,7 +63,7 @@ is Fl_Surface_Device::push_current( ) / Fl_Surface_Device::pop_current().*/ void Fl_Surface_Device::set_current(void) { - if (surface_) surface_->end_current_(); + if (surface_) surface_->end_current(); fl_graphics_driver = pGraphicsDriver; surface_ = this; pGraphicsDriver->global_gc(); -- cgit v1.2.3