Applet.destroy()

I

Ike

If someone just closes a browser instance, which is running an Applet, is

public void destroy()

invoked in all cases (i.e. for all OS's, all broswers?) -Ike
 
V

Vova Reznik

Ike said:
If someone just closes a browser instance, which is running an Applet, is

public void destroy()

invoked in all cases (i.e. for all OS's, all broswers?) -Ike

As javadoc says:
"Called by the browser or applet viewer to inform this applet that it is
being reclaimed and that it should destroy any resources that it has
allocated. The stop method will always be called before destroy.

A subclass of Applet should override this method if it has any operation
that it wants to perform before it is destroyed. For example, an applet
with threads would use the init method to create the threads and the
destroy method to kill them.

The implementation of this method provided by the Applet class does
nothing. "
 
C

Chris Uppal

Ike said:
If someone just closes a browser instance, which is running an Applet, is
public void destroy()
invoked in all cases (i.e. for all OS's, all broswers?) -Ike

I doubt it. Why should it ? Indeed, how can it ? If the browser is being
killed, it doesn't necessarily get any choice in the matter nor any chance to
clean up (even if it wanted to).

Consider what happens if someone turns the computer off ;-)

-- chris
 
O

Oliver Wong

Chris Uppal said:
I doubt it. Why should it ? Indeed, how can it ? If the browser is
being
killed, it doesn't necessarily get any choice in the matter nor any chance
to
clean up (even if it wanted to).

Consider what happens if someone turns the computer off ;-)

When asking yourself "for all OS's, all browser?" type of questions,
consider that someone may, immediately after reading your newsgroup post,
maliciously decide to specifically write a browser or OS combination which
does not satisfy your requirements; then ask yourself what that means for
your application design. In some cases, you won't care about such rogue
browser/OS combinations. But in other cases (e.g. the security of your
application server depends on certain behaviour), you will care very much.

- Oliver
 
C

Chris Uppal

Oliver said:
When asking yourself "for all OS's, all browser?" type of questions,
consider that someone may, immediately after reading your newsgroup post,
maliciously decide to specifically write a browser or OS combination which
does not satisfy your requirements; then ask yourself what that means for
your application design.

Nicely put.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top