diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-10-02 08:40:38 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-10-02 08:40:38 +0200 |
| commit | abc6709e8e93594152e27710f25f24c36318d520 (patch) | |
| tree | 370a462a48fdeaa0fd2553d22175ebfbcdfc436e | |
| parent | 63a7942a6692ce1ec66746bd6fd3c16812125a48 (diff) | |
macOS: simpler way to delete the GL1 context of widgets-using GL3 windows.
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm | 12 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H index 01ab231c2..9d7e6dff3 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H @@ -52,7 +52,6 @@ class Fl_Cocoa_Gl_Window_Driver : public Fl_Gl_Window_Driver { void apply_scissor(); virtual void switch_to_GL1(); virtual void switch_back(); - virtual void gl_hide_before(void *&); }; diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm index 429fad370..fb6690dcb 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm +++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm @@ -217,6 +217,10 @@ void Fl_Cocoa_Gl_Window_Driver::delete_gl_context(GLContext context) { } [(NSOpenGLContext*)context release]; del_context(context); + if (gl1ctxt) { + [gl1ctxt release]; + gl1ctxt = 0; + } } void Fl_Cocoa_Gl_Window_Driver::make_overlay_current() { @@ -492,14 +496,6 @@ void Fl_Cocoa_Gl_Window_Driver::switch_back() { } -void Fl_Cocoa_Gl_Window_Driver::gl_hide_before(void *&) { - if (gl1ctxt) { - [gl1ctxt release]; - gl1ctxt = 0; - } -} - - class Fl_Gl_Cocoa_Plugin : public Fl_Cocoa_Plugin { public: Fl_Gl_Cocoa_Plugin() : Fl_Cocoa_Plugin(name()) { } |
