Please do not post to FLTK bugs. Post to General instead. Thanks.

Begin forwarded message:

> From: claude roux <[email protected]>
> Subject: [fltk.bugs] Mac OS: bug in make_current
> Date: 19. Dezember 2012 13:39:52 MEZ
> To: [email protected]
> Reply-To: "Mirror of fltk.bugs Newsgroup" <[email protected]>
> 
> Hello,
> 
> I have been using FLTK for quite a while now (about a year), and with some 
> success. I use the 1.3.2 version, which I have integrated in projects on 
> Windows, Mac OS and Linux.
> 
> However, I have a real problem on Mac OS, a crash which happens in certain 
> cases when I mix a (non FLTK) modal window and an FLTK window. When I destroy 
> the FLTK window, I have a crash...
> 
> I traced the error back to Fl::make_current in Fl_cocoa.mm, with a lockFocus, 
> which is where the bug is perpetrated...
> 
> For the moment, the only way for me to bypass this problem is to add a 
> @try/@catch around the lockFocus and I destroy the window...
> 
> void Fl_Window::make_current() {
> ..
>    NSView *current_focus = [NSView focusView];
>    // sometimes current_focus is set to a non-FLTK view: don't touch that
>    @try {
>        if ( [current_focus isKindOfClass:[FLView class]] )
>            [current_focus unlockFocus];
>        [[i->xid contentView]  lockFocus]; <-- CRASH HERE
>    }
>    @catch(NSException* e) {
>        delete this;  <-- VERY HORRIBLE, but it does not seem to matter
>        return;
>    }
> 
> 
> It works, but I do not feel very comfortable to modify the code of a library 
> which I use on many platform.
> 
> Do you have any idea how I could bypass this error in a more acceptable way?
> 
> Thank you in advance...
> 
> 
> 
> _______________________________________________
> fltk-bugs mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk-bugs

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to