﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1944	AdlibUnRegister not working trusty	Devol		"Hello,

Here an example:

{{{
#include <GUIConstantsEx.au3>

Opt(""GUIOnEventMode"", 1)

Global $Label, $iPos = 0 , $sleep = 10

$Form1 = GUICreate(""Adlibtest - Sleep(""&$sleep&"")"", 240, 100, 990, 30)
GUISetOnEvent(-3, ""_Exit"")
$Label = GUICtrlCreateLabel(""Testlabel"", 25, 14, 300, 16)
GUICtrlSetFont(-1, 11, 800, 0, ""MS Sans Serif"")
$Button1 = GUICtrlCreateButton(""Start"",15,50,60,40)
GUICtrlSetOnEvent(-1,""_startadlib"")
$Button2 = GUICtrlCreateButton(""Stop"",120,50,60,40)
GUICtrlSetOnEvent(-1,""_stopadlib"")
GUISetState(@SW_SHOW)

While Sleep($sleep) ; the higher the sleep , the more often the labelswitch fails
WEnd

Func _startadlib()
GUICtrlSetData($Label,""Running"")
AdlibRegister(""_Laufschrift"")
EndFunc

Func _stopadlib()
AdlibUnRegister(""_Laufschrift"")
GUICtrlSetData($Label,""Stopped"") ; labelswitch failing sometimes 
EndFunc

Func _Exit()
    Exit
EndFunc

Func _Laufschrift()
    GUICtrlSetData($Label, StringMid(""Running"", $iPos) & ""           "" & ""Running"")
    $iPos += 1.8
    If $iPos > StringLen(""Running"") Then $iPos = 0
EndFunc
}}}


I tested this script on several pcs but the behavoir is always the same.
AdlibUnRegister 
== sometimes ==
 fails and the subsequent command is not being executed.

You can try the examplescript , just click the buttons ""Start"" and ""Stop"" by turns.(wait 1-2 secs. before clicking stop) 
Sooner or later the label will be stopped on ""Running Running Running"" despite of the GuictrlsetData($Label,""Stopped"").

Bug or not? :)

Greetz Devol

PS: I talked to the german forum before opening this ticket.
"	Bug	closed		AutoIt	3.3.6.1	None	No Bug		
