Opened 18 years ago
Closed 18 years ago
#387 closed Bug (Fixed)
Change DllCallbackFree() to check handle validation or erase it
| Reported by: | 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 , 18 years ago
| Milestone: | Future Release |
|---|---|
| Version: | 3.2.12.0 |
comment:3 by , 18 years ago
| Type: | Feature Request → Bug |
|---|---|
| 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:5 by , 18 years ago
| Milestone: | → 3.2.13.4 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed in version: 3.2.13.4

Automatic ticket cleanup.