FLTK logo

[Library] r10019 - /branches/branch-1.3/src

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r10019 - /branches/branch-1.3/src [manolo] Nov 13, 2013  
 
 ------------------------------------------------------------------------
 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 ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.