diff options
| author | Manolo Gouy <Manolo> | 2013-11-13 15:49:48 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2013-11-13 15:49:48 +0000 |
| commit | 6b67e50cbee9db2f15ed3b0f037a3d90aafdc1aa (patch) | |
| tree | 7420ea50e14a10992ff46e1217c8458ec0c08575 /src | |
| parent | 88cea3c82dd821e652608fcccce229fea0249d08 (diff) | |
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.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10019 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 8033120ca..7e72e3cf9 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -463,9 +463,7 @@ static void processFLTKEvent(void) { * 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 @@ static void breakMacEventLoop() windowNumber:0 context:NULL subtype:FLTKTimerEvent data1:0 data2:0]; [NSApp postEvent:event atStart:NO]; - fl_unlock_function(); } // @@ -521,6 +518,7 @@ static void delete_timer(MacTimeout& t) 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 @@ static void do_timer(CFRunLoopTimerRef timer, void* data) current_timer = NULL; breakMacEventLoop(); + fl_unlock_function(); } void Fl::add_timeout(double time, Fl_Timeout_Handler cb, void* data) |
