Results 1 to 4 of 4
  1.    #1  
    I was looking at some sample code and noticed something like the following:
    Code:
    main.prototype.cleanup = function (event) {
        this.setupModel = null;
        this.themeModel = null;
        this.defaultModel = null;
        this.saveCookie = null;
    };
    Is it necessary to "delete" all the created objects in "cleanup" or do they automatically get deleted when the app closes?
  2. #2  
    Setting references to null allows that garbage collector to more quickly pick up discarded objects, which can help reduce the memory footprint of your app. If objects are anything more complex than a very small array, I like to try to clean them up.

    You really must clean up event handlers. I'm still not sure if there is any better way to clean up a DB object other than just setting to null. In proper design, you are only opening one of those per DB per App anyway, so that isn't too big of a deal.
    Your Pre wants Word Whirl from the App Catalog.

    It told me.
  3.    #3  
    Setting references to null allows that garbage collector to more quickly pick up discarded objects, which can help reduce the memory footprint of your app.
    So in other words, Webos does not do automatic garbage collection upon the app closing? Is this correct?
  4. #4  
    I believe the cleanup is for when you close stages and scenes. A lot of Palm apps don't seem to bother with very much cleanup at all.

Posting Permissions