Re: Timer issue?

Jon Ogden <[email protected]> Wed, 01 Aug 2018 08:56:18 -0400
Newsgroups gmane.comp.lang.realbasic.user
Message-ID <[email protected]>
Try  a Xojo 2017 version and see if the same problem happens. Just a guess. 

Sent from my iPhone

> On Aug 1, 2018, at 8:18 AM, Jean-Luc Arnaud <jean-luc-E/[email protected]> wrote:
> 
> Xojo 2018r1.1, OS X 10.13.6, 64bit.
> 
> Sorry for forgetting this information.
> 
> Jean-Luc Arnaud
> 
>> Le 01/08/2018 à 13:59, Jon Ogden a écrit :
>> What version Xojo?  What OS?  64 bit?
>> 
>> Sent from my iPhone
>> 
>>> On Aug 1, 2018, at 6:43 AM, Jean-Luc Arnaud <jean-luc-E/[email protected]> wrote:
>>> 
>>> Hi all,
>>> 
>>> I'm using a timer in order to terminate a thread treatment:
>>> 
>>> - When finished, the thread sets a flag to True and terminates (verified),
>>> 
>>> - In the Timer (with a period of 10), when the flag is on, the timer sets itself to off and then calls a method selecting the next file to be treated.
>>> 
>>> Globally, this works but sometimes, I'm getting a "File already opened" error that I send when this method tries to open the same file that is already opened. This should never happen !!! It's like the method is called again whereas it has already opened a new file and tries to reopen it ! I have verified that this is always a new file, never the last treated file.
>>> 
>>> Here is what I'm getting raising a Runtime error when this happens:
>>> 
>>> RuntimeRaiseException
>>> MainWindow.MainWindow.Next_File%%o<MainWindow.MainWindow>
>>> MainWindow.MainWindow.Refresh_Timer_Action%%o<MainWindow.MainWindow>o<Timer>
>>> XojoFramework$13892
>>> __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
>>> __CFRunLoopDoTimer
>>> __CFRunLoopDoTimers
>>> __CFRunLoopRun
>>> CFRunLoopRunSpecific
>>> RunCurrentEventLoopInMode
>>> ReceiveNextEventCommon
>>> _BlockUntilNextEventMatchingListInModeWithFilter
>>> _DPSNextEvent
>>> -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
>>> XojoFramework$4483
>>> XojoFramework$4484
>>> Application._CallFunctionWithExceptionHandling%%o<Application>p
>>> _Z33CallFunctionWithExceptionHandlingPFvvE
>>> XojoFramework$4483
>>> -[NSApplication run]
>>> RuntimeRun
>>> REALbasic._RuntimeRun
>>> _Main
>>> main
>>> 
>>> Can you help me understand what's happening ?
>>> 
>>> TIA
>>> 
>>> -- 
>>> Jean-Luc Arnaud
>>> 
>