Modify

Opened 18 years ago

Closed 18 years ago

#387 closed Bug (Fixed)

Change DllCallbackFree() to check handle validation or erase it

Reported by: MsCreatoR <mscreator@…> Owned by: Jon
Milestone: 3.2.13.4 Component: AutoIt
Version: 3.2.12.1 Severity: None
Keywords: DllCallbackFree Crash Cc:

Description

From the help file:

If handle is invalid, an AutoIt runtime error will be thrown, and the script will terminate!

First of all, i think none of built-in functions should not to hard crash the script.
But if it's really inevitably, those functions should (optional?) recieve handle ByRef, and change the $handle to 0 after it's releasing the CallBack. Something like this:

Func _DllCallbackFree(ByRef $Handle)
	If $Handle > 0 Then
		DllCallbackFree($Handle)
		$Handle = 0
		Return
	EndIf
	
	Return -1
EndFunc

Because for now there is a chance that our script can crash when it's not supose to (in the middle of some task).

Thanks.

Attachments (0)

Change History (5)

comment:1 by TicketCleanup, 18 years ago

Milestone: Future Release
Version: 3.2.12.0

Automatic ticket cleanup.

comment:2 by Jon, 18 years ago

I don't understand.

comment:3 by Valik, 18 years ago

Type: Feature RequestBug
Version: 3.2.12.1

Jon, from the sounds of it, this is the same thing you used to have in place when an invalid file handle was passed to FileClose(). Remember how it used to throw up an error and stop the script? Remember how I bitched about that?

Oh, and this crashes AutoIt. Stupid, yes, but I was trying to generate something simple to reproduce the bug and ended up with a hard-crash:

DllCallbackFree(32)

Incidentally, flagging this as a bug, not a feature request.

comment:4 by Jon, 18 years ago

Oh I see. K, I've removed the message for this and DllClose() as well.

comment:5 by Jon, 18 years ago

Milestone: 3.2.13.4
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed in version: 3.2.13.4

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.