DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2848
Version: 1.3-current
Attached file "cocoa.diff"...
Link: http://www.fltk.org/str.php?L2848
Version: 1.3-current
Index: src/Fl_cocoa.mm
===================================================================
--- src/Fl_cocoa.mm (revision 9420)
+++ src/Fl_cocoa.mm (working copy)
@@ -326,8 +326,6 @@
void* DataReady::DataReadyThread(void *o)
{
DataReady *self = (DataReady*)o;
- NSAutoreleasePool *localPool;
- localPool = [[NSAutoreleasePool alloc] init];
while ( 1 ) { // loop until thread
cancel or error
// Thread safe local copies of data before each select()
self->DataLock();
@@ -358,12 +356,15 @@
{ return(NULL); } // just
exit
DEBUGMSG("CHILD THREAD: DATA IS READY\n");
NSPoint pt={0,0};
+ NSAutoreleasePool *localPool;
+ localPool = [[NSAutoreleasePool alloc] init];
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
location:pt
modifierFlags:0
timestamp:0
windowNumber:0 context:NULL
subtype:FLTKDataReadyEvent data1:0
data2:0];
[NSApp postEvent:event atStart:NO];
+ [localPool release];
return(NULL); // done with thread
}
}
@@ -1280,6 +1281,8 @@
selector:@selector(anyWindowWillClose:)
name:NSWindowWillCloseNotification
object:nil];
+ [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil];
+ //NSLog(@"end of fl_open_display isMultiThreaded=%d",[NSThread
isMultiThreaded]);
}
}
_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs