Applet.destroy()

Discussion in 'Java' started by Ike, Feb 28, 2006.

  1. Ike

    Ike Guest

    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
     
    Ike, Feb 28, 2006
    #1
    1. Advertising

  2. Ike

    Vova Reznik Guest

    Ike wrote:
    > 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. "
     
    Vova Reznik, Feb 28, 2006
    #2
    1. Advertising

  3. Ike

    Chris Uppal Guest

    Ike wrote:

    > 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
     
    Chris Uppal, Feb 28, 2006
    #3
  4. Ike

    Oliver Wong Guest

    "Chris Uppal" <-THIS.org> wrote in message
    news:44047a8a$1$1169$...
    > Ike wrote:
    >
    >> 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 ;-)


    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
     
    Oliver Wong, Feb 28, 2006
    #4
  5. Ike

    Chris Uppal Guest

    Oliver Wong wrote:

    > 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
     
    Chris Uppal, Feb 28, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. troy makaro
    Replies:
    8
    Views:
    764
    Andrew Thompson
    Oct 8, 2005
  2. VisionSet
    Replies:
    3
    Views:
    508
    VisionSet
    Jun 27, 2006
  3. Replies:
    0
    Views:
    563
  4. Ook
    Replies:
    2
    Views:
    337
  5. Vasu
    Replies:
    1
    Views:
    2,810
    Mark Space
    Jan 21, 2009
Loading...

Share This Page