FLTK logo

[master] 4daec2a - macOS: Fix release of extra NSView holding child widgets of GL window

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 4daec2a - macOS: Fix release of extra NSView holding child widgets of GL window "ManoloFLTK" Nov 22, 2022  
 
commit 4daec2a9408c674f8d62f8770ec8c035c25f2294
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Nov 22 19:18:29 2022 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Nov 22 19:18:29 2022 +0100

    macOS: Fix release of extra NSView holding child widgets of GL window

 src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index c2e618e..385b630 100644
--- src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
@@ -218,6 +218,7 @@ void Fl_Cocoa_Gl_Window_Driver::delete_gl_context(GLContext context) {
   [(NSOpenGLContext*)context release];
   del_context(context);
   if (gl1ctxt) {
+    [[gl1ctxt view] release];
     [gl1ctxt release];
     gl1ctxt = 0;
   }
@@ -456,7 +457,6 @@ static struct win_view {
 static void delayed_addgl1ctxt(struct win_view *data) {
   NSView *flview = [fl_mac_xid(data->win) contentView];
   [flview addSubview:data->gl1view];
-  [data->gl1view release];
 #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_7
   if (fl_mac_os_version >= 100700 && Fl::use_high_res_GL()) {
     [data->gl1view setWantsBestResolutionOpenGLSurface:YES];
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.