ahkTerminate[] kills main script too. Topic is solved

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
murataygun
Posts: 104
Joined: 07 Aug 2015, 15:53

ahkTerminate[] kills main script too.

13 Nov 2022, 10:54

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?
murataygun
Posts: 104
Joined: 07 Aug 2015, 15:53

Re: ahkTerminate[] kills main script too.  Topic is solved

14 Nov 2022, 10:53

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;

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")
		}
and the called this.ws.Disconnect function as follows;

Code: Select all

			Disconnect()
			{
				if this.hWnd
				{
					this.Close()
					Gui, % this.hWnd ": Destroy"
					this.hWnd := False
				}
			}
What are the odds :roll:

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 103 guests