Weird crash when using criticalObject() and hotkey, ifwinactive
Posted: 08 Apr 2018, 05:36
Try this out:
Main.ahk
Thread.ahk
It will always crash.
Is there a bug in this code or in AutoHotkey_H (v 1.1.28.0)?
Main.ahk
Code: Select all
FileRead,ThreadCode,% "Thread.ahk"
_share:=criticalObject()
AhkThread := AhkThread("_share:=CriticalObject(" &_share ")`n" ThreadCode)
MsgBox klick ok to terminate
if (AhkThread.ahkReady())
{
AhkThread.ahkterminate(-100)
}
ExitApp
Code: Select all
CoordMode,ToolTip,screen
parentAHKThread := AhkExported()
hotkey, ifwinactive, asdf ;Remove this line and it will not crash
Loop
{
;Or remove those tree lines an it will not crash
_share.index:=A_Index
if (_share.index / 1000 == _share.index // 1000)
ToolTip % _share.index
}
return