I’m trying to use either Kem’s Kaju or MBS’s Updater routines, both of them issue a Quit to close the app before re-opening the new version.
However, the Quit command doesn’t quit the app - it just gives me a “beep” and no indication of where the problem occurs.
I’ve tried inserting an app.CancelClose event - but it doesn’t get that far - something else stops the quit.
I have one window with a cancelClose event, but it doesn’t reach that either.
If I use the File/Quit menu from the same location, that works fine.
Further, if I force close any open windows first I get an EndException on quit, which I suppose I could ignore. But this seems a hard way to make the quit function do its job.
[code]//manually close all windows
while window(0) <> nil
'dim s as string = window(0).Title
window(0).close
wend
quit
Exception err
select case err
case isa EndException
MsgBox “EndException”
end select[/code]
Put a break point on the quit
Then when you hit the break point say where the quit is (ie/ the action event of a button on a modal dialog etc)
20 questions isn’t going to get an answer very quickly
[quote=173644:@Norman Palardy]Put a break point on the quit
Then when you hit the break point say where the quit is (ie/ the action event of a button on a modal dialog etc)[/quote]
The quit is issued by a button.actio marked quit. There’s nought more complicated than that. The break point just shows the button.action as the calling item.
If you have a Try/Catch that catches all exceptions, you should write it this way:
try
// some code
catch err as RuntimeException
if err IsA EndException or err IsA ThreadEndException then
raise err
else
// Deal with your exception
end if
end try
Of course, if you know the type of exception you are looking for, you should only catch it specifically.
The global LogMyDeath method would look something like this:
Sub LogMyDeath (o As Object, topOfMethod As Boolean)
const kDebug = true
#if kDebug
dim ti as Introspection.TypeInfo = Introspection.GetType( o )
dim name as string = ti.FullName
dim msg as string = "The object " + name + " " + _
if( topOfMethod, "is about to die...", "has died" )
System.DebugLog msg
#else
#pragma unused o
#pragma unused topOfMethod
#endif
End Sub
On quit, you can check the log to see which Destructor is not finishing. Once you’ve found the problem(s), you can switch off the constant so it won’t affect your final code.
At a quick count I have about 200 objects defined, excluding all the objects in MacOSLib and other external pieces of software, so this might take a while.