|
|
commit abc6709e8e93594152e27710f25f24c36318d520
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Sun Oct 2 08:40:38 2022 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Sun Oct 2 08:40:38 2022 +0200
macOS: simpler way to delete the GL1 context of widgets-using GL3 windows.
src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H | 1 -
src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm | 12 ++++--------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H
index 01ab231..9d7e6df 100644
--- src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.H
+++ 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 src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index 429fad3..fb6690d 100644
--- src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ 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()) { }
[ Direct Link to Message ] | |
|
| |