ahkThread_Free, ahkTerminate, or both? Confusing.
Posted: 04 Mar 2018, 11:42
Since a rather complex script, when compiled, is still randomly crashing either on start or on restart, either on one machine or another, either in a folder or another, I'd like some clarifications on exiting the threads started by main script before restarting/reloading it.
Said script crashes regardless of whether is compiled with the bin or the exe, and the error is always the same:
"The instruction at <address> referenced memory at 0x00000014; memory could not be read". Instruction address changes from one compile to another but memory address being referenced remains the same. As the title says, being unfamiliar with AHK_H I don't know exactly what each of the two functions does and which is best to use to exit a thread in a clean manner.
Additionally, I'd like to know whether threads do execute any OnExit command when closed and which of the two functions allows the OnExit label/function to be executed completely before exiting the thread.
Oh and almost forgot: can those functions be called dynamically (for compatibility with AHK_L)? In example:
I'm trying to eliminate any possible bugs and coding errors from the script before blaming it on AHK_H itself, therefore any help would be appreciated. Thank you.
Said script crashes regardless of whether is compiled with the bin or the exe, and the error is always the same:
"The instruction at <address> referenced memory at 0x00000014; memory could not be read". Instruction address changes from one compile to another but memory address being referenced remains the same. As the title says, being unfamiliar with AHK_H I don't know exactly what each of the two functions does and which is best to use to exit a thread in a clean manner.
Additionally, I'd like to know whether threads do execute any OnExit command when closed and which of the two functions allows the OnExit label/function to be executed completely before exiting the thread.
Oh and almost forgot: can those functions be called dynamically (for compatibility with AHK_L)? In example:
Code: Select all
endfunc := "ahkThread_Free"
termfunc := "ahkTerminate"
If isAhkH
%endfunc%(myThread)
; or
myThread.%termfunc%[timer]