Without looking at the source, but this "***** INTERNAL ERROR ***** Attempt to release <unknown> object" reminds me of only one thing: Before you end the program with 'End' add this: "Setbuffer Desktopbuffer()"
a minor nittpick about your loop:
Repeat
Until WaitEvent()=$803
End
is better to be done as:
Repeat
WaitEvent()
If EventID()=$803 quit=true
Until quit
; clean-up here
End
The handy part is that you can quit the program from anywhere then by making 'quit' a global. You could ofcourse also type 'End' anywhere but that doesn't give you the opportunity to clean things up first.
a minor nittpick about your loop:
Repeat
Until WaitEvent()=$803
End
is better to be done as:
Repeat
WaitEvent()
If EventID()=$803 quit=true
Until quit
; clean-up here
End
The handy part is that you can quit the program from anywhere then by making 'quit' a global. You could ofcourse also type 'End' anywhere but that doesn't give you the opportunity to clean things up first.