[v1.1.32.00] AhkExported + AhkPostFunction from thread results in a crash Topic is solved

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
User avatar
lvalkov
Posts: 56
Joined: 08 Mar 2019, 16:39

[v1.1.32.00] AhkExported + AhkPostFunction from thread results in a crash

24 Jun 2020, 17:39

Code: Select all

AhkThread("AhkExported().AhkPostFunction(""threadCallback"", ""Sent from thread."")")

threadCallback(msg) {
	MsgBox % msg
}

MsgBox
Executing the above snippet with AutoHotkey_H v1.1.32.00 (434d51) results in the thread callback message box being shown briefly, after which point the parent script hangs and a short while later crashes with STATUS_HEAP_CORRUPTION.

Contrast this to executing the AutoHotkey_H v2.0-a110 (2f077b2) syntactic counterpart, where neither crashes nor hangs can be observed. First, the thread callback message box is displayed. It is only then, after it has been dismissed, that the parent script's default message box pops up.

Code: Select all

AhkThread('AhkExported().AhkPostFunction("threadCallback", "Sent from thread.")')

threadCallback(msg) => MsgBox(msg)

MsgBox
Both scripts were ran with their respective 64-bit Unicode /MD interpreters on Windows 10 Build 20H1.

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 3 guests