Opened 10 years ago
Closed 4 years ago
#2979 closed Bug (Works For Me)
AdlibUnregister failing to release timer
Reported by: | czardas | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | 3.3.12.0 | Severity: | None |
Keywords: | AdlibUnregister Timer | Cc: |
Description
After AdlibUnregister, the original time interval is retained in memory instead of it being released. This causes a problem when you register the same function again. There should always be approximately 10 seconds between each return and new call to the function in the example below, however it goes wildly out of sync after the first run.
Global $iTimer = TimerInit(), $iSleep = 10000
AdlibRegister("AdlibTimer", $iSleep)
While 1
Sleep(20)
WEnd
Func AdlibTimer()
ConsoleWrite(TimerDiff($iTimer) & @LF) ; Time since the last visit.
AdlibUnRegister("AdlibTimer") ; This should clear everything.
Sleep($iSleep/2) ; Waste a bit of time.
AdlibRegister("AdlibTimer", $iSleep) ; The timer was not reset.
$iTimer = TimerInit() ; The time AdlibTimer was registered.
EndFunc ==
Actually SmOkE_N discovered this issue - see the following link:
http://www.autoitscript.com/forum/topic/167126-adlibregister-issue/?p=1222290
Attachments (0)
Change History (2)
comment:1 Changed 10 years ago by czardas
comment:2 Changed 4 years ago by Jpm
- Resolution set to Works For Me
- Status changed from new to closed
Hi,
Checking with the last release works for me
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Reposting the code because I hit the wrong button before.