CAB application takes a long time to terminate

Topics: CAB & Smart Client Software Factory
Apr 24, 2006 at 9:39 PM
originally posted by: hayrob1

My first (and not very cleverly designed) CAB application works fine ... but.... When the User closes the main form and terminates the application, it takes from 3 to 15 seconds for the app to finally finish. I can see that all the CAB objects which were created by the app are being disposed (which is clearly the right thing to do), but it does take along time.

Should I just live with this behaviour and use a Close - Please wait form while the dispose takes place, or is there a better (different) solution.

May 2, 2006 at 8:38 AM
originally posted by: DLorenz

Do you do Application.Exit() in order to close your app? Also, before that, do you call Rootworkitem.Terminate()?
May 2, 2006 at 8:57 PM
originally posted by: hayrob1

No - the User or the Application closes the ShellApplicationForm. And the Application does not call RootWorkItem.Terminate. The Dispose method is called from the CabApplication class.

Is calling Application.Exit the recommended way to terminate a CAB application?

Thanks for your help.
May 3, 2006 at 3:42 AM
originally posted by: DLorenz

I think it depends on what you need. If you have logic in your OnTerminating calls in any of your workitems, then you should probably Terminate the Root before exiting. Then I would probably call Application.Exit at the very end. I don't know if there is a "recommended" way to exit, but I know it gets the job done.