Main thread has #Persistent Tag.
A hotkey creates thread. Thread does its jop. When finishes calls a function on main script (ahkExported). Main script terminates thread but it allso exits without error. What may be the couse of this?
ahkTerminate[] kills main script too. Topic is solved
-
- Posts: 104
- Joined: 07 Aug 2015, 15:53
Re: ahkTerminate[] kills main script too. Topic is solved
I was using Chrome.ahk in that thread and i dont know why, when i use PageInst.Disconnect() function and ahkTerminate[] one after the other main script shuts itself down. Page.Inst function from Chrome.ahk;
and the called this.ws.Disconnect function as follows;
What are the odds
Code: Select all
Disconnect()
{
if !this.Connected
return
this.Connected := False
this.ws.Delete("Parent")
this.ws.Disconnect()
BoundKeepAlive := this.BoundKeepAlive
SetTimer, %BoundKeepAlive%, Delete
this.Delete("BoundKeepAlive")
}
Code: Select all
Disconnect()
{
if this.hWnd
{
this.Close()
Gui, % this.hWnd ": Destroy"
this.hWnd := False
}
}