File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes destroy() method not called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "destroy() method not called" Watch "destroy() method not called" New topic

destroy() method not called

Nesan Krish
Ranch Hand

Joined: Feb 20, 2004
Posts: 40
When I close my applet stop()or destroy() methods are NOT called, why? Can this relate to browser/operating system gugrade. (I am using Internet Explorer 6.0 and Windows XP service pack 1. Thank you.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

What do you mean by "close your applet?" If you open a Frame in your applet, and then close the Frame, this won't cause stop() or destroy() to be called. But stop() should be called when you browse to another page from the one your applet is embedded in, and destroy() would be called if the browser decides to dispose the class loader that created your applet.

[Jess in Action][AskingGoodQuestions]
Nesan Krish
Ranch Hand

Joined: Feb 20, 2004
Posts: 40
stop() or destroy() methods are not called when I close the browser (or surf some other web page) where the applet embeded in.
Korol Bloom
Ranch Hand

Joined: Jan 13, 2004
Posts: 33
I had a problem once with a missed stop(), that was related to the use of the singleton pattern and synchronization. The browser's call of stop() caused a kind of deadlock blocking my applet.

, korol
I agree. Here's the link:
subject: destroy() method not called
It's not a secret anymore!