On 1 Jun 2012, at 20:46, Greg Ercolano wrote: > Hi Manolo, > > Since you're our Fl_Cocoa.mm guru, was wondering if you could > weigh in on the bug Peeter found a few weeks ago, and my proposed > solution that advises we perhaps switch our use of pthreads > in Fl_Cocoa (for handling add_fd()) over to using NSThread. > > I think I did all the investigative work and found the solution, > but not sure I'm the right person to code it. > > I wrote the original carbon threading code in question > (the add_fd() threading stuff), and I think that's been > fairly bug free, but apparently during the recent port to cocoa > pthreads apparently doesn't play nice with the cocoa libs. > > By switching from using pthreads to NSThread in just the Fl_Cocoa code > might solve the memory leak. > > Please see the STR for details: > http://fltk.org/str.php?L2848 > > This should maybe be a HIGH instead of a MED, as apparently a lot > of memory is leaking..
On the basis of no useful knowledge at all, I was under the impression that it would play fine with pthreads, if you made at least one (possibly dummy) NSThread first, just to "wake up" the thread safe mechanisms... So it may NOT be necessary to change the code much, just add in a dummy NSThread somewhere that we then immediately expire... But most likely I'm talking nonsense... _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
