|
|
------------------------------------------------------------------------
r10019 | manolo | 2013-11-13 10:49:48 -0500 (Wed, 13 Nov 2013) | 2 lines
Changed paths:
M /branches/branch-1.3/src/Fl_cocoa.mm
Bracket calls to timer callbacks with fl_lock_function()/fl_unlock_function() as occurs under WIN32 and X11.
This was also missing in the FLTK 1.1 carbon version.
------------------------------------------------------------------------
Index: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm (revision 10018)
+++ branches/branch-1.3/src/Fl_cocoa.mm (revision 10019)
@@ -463,9 +463,7 @@
* break the current event loop
*/
static void breakMacEventLoop()
-{
- fl_lock_function();
-
+{
NSPoint pt={0,0};
NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined location:pt
modifierFlags:0
@@ -473,7 +471,6 @@
windowNumber:0 context:NULL
subtype:FLTKTimerEvent data1:0 data2:0];
[NSApp postEvent:event atStart:NO];
- fl_unlock_function();
}
//
@@ -521,6 +518,7 @@
static void do_timer(CFRunLoopTimerRef timer, void* data)
{
+ fl_lock_function();
current_timer = (MacTimeout*)data;
current_timer->pending = 0;
(current_timer->callback)(current_timer->data);
@@ -529,6 +527,7 @@
current_timer = NULL;
breakMacEventLoop();
+ fl_unlock_function();
}
void Fl::add_timeout(double time, Fl_Timeout_Handler cb, void* data)
[ Direct Link to Message ] | |
|
| |