Thank you for your reply. Lots of good info.
__Delete should probably report all exceptions immediately (acting as if called from a new thread).
To further motivate this, consider a more accurate representation of what I was doing when I got problems with this in the first place,
Code: Select all
loop 1000 {
tooltip % "Everything seems fine at line: " A_Index
if (A_Index=400){
new a
;abs(0) ; compare to when this is uncommented. (lol)
}
}
Msgbox Done!
return
class a{
__Delete(){
a()
}
}
; Some function library
a(){
b()
}
b(){
c()
}
c(){
d()
}
d(){
throw Exception("Something happened",-3)
}
I will continue as if this post was in the ask for help section. Regarding meaningfulness
(word?) of throwing in
__Delete, the program does it, eg
Code: Select all
__Delete(){
gui, %invalidHandle%: Destroy
}
The error message says the thread will exit, but it seems it only makes the
__Delete() function return/stop. for example,
Code: Select all
f::
SendMode, Play
; gui %invalidHandle%: destroy ; <- This will exit the thread (expected)
new a
msgbox
return
class a{
__Delete(){
msgbox, % A_SendMode
gui %invalidHandle%: destroy ; <- this says it will exit the thread, expected, but which thread is it exiting?
}
}
(where the
ask-for-help is in the last comment)
Thanks for your time. Cheers.