Page 1 of 1

Search Script "Invalid pointer operation"

Posted: Fri Jul 05, 2013 10:39 am
by CarlitoGil
When a Search Script calls SDB.ProcessMessages from a timer and the Auto-tag window is closed MM throws an error:

Code: Select all

Error executing script event
Invalid pointer operation
This is a sample script:

Code: Select all

Dim bHalt
bHalt = False

Sub StartSearch(oPanel, sSearchTerm, sSearchArtist, sSearchAlbum)
 	Script.RegisterEvent SDB.CreateTimer(0), "OnTimer", "Timeout"
End Sub

Sub FinishSearch(oPanel)
	bHalt = True
	Script.UnRegisterAllEvents
End Sub

Sub Timeout(tTimer)

	tTimer.Enabled = False
	
	SDB.Tools.Sleep(1000)
	
	SDB.ProcessMessages
	
	If bHalt Then
		msgbox("Halted! but will throw an error!")
	Else
		tTimer.Enabled = True
	End If
	
End Sub
4.0.7.1511
Windows 8 x64

Re: Search Script "Invalid pointer operation"

Posted: Fri Jul 05, 2013 8:38 pm
by Peke
From what I see Timer/event is triggered even Script is terminated.

Have you tried to unregister Timer?

Re: Search Script "Invalid pointer operation"

Posted: Fri Jul 05, 2013 8:47 pm
by CarlitoGil
Peke wrote:Have you tried to unregister Timer?
Yeah, I used Script.UnRegisterAllEvents, but it didn't work.

Re: Search Script "Invalid pointer operation"

Posted: Wed Jul 10, 2013 7:58 am
by CarlitoGil
Can somebody, please, reproduce this and give it a bug number?

Re: Search Script "Invalid pointer operation"

Posted: Wed Jul 10, 2013 5:28 pm
by Peke
Sure, I'll do in deep tests to see what/why/how.

Re: Search Script "Invalid pointer operation"

Posted: Wed Jul 10, 2013 5:32 pm
by CarlitoGil
Thank you, man.