Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Contributor
khafra
Posts: 16
Registered: ‎05-17-2011
My Carrier: Bmobile
Accepted Solution

Still getting "Previous instance still active" using the Webworks 2.3 SDK

My app is fairly simple:

 

  • jquery (1.3.2) ajax request to JSON web service for a list of items
  • loop through results to produce list (approx 20-30 items in the list)
  • user clicks on item which initiates another ajax call for the item's details
  • to exit i call system.exit() using the apis
  • the app uses no custom extensions
  • in the app i also use the messages and calender apis (for sending and adding reminders)

 

After a few sessions of using the app, i get the "Previous instance still active (report to http://go/memoryleaks)" error. I know the GC is being called as i see the spinning clock on exit.

 

in the application manager on OS7 i can see that the app exceeds 2MB of memory at times.

 

Can anyone suggest what aspects of my implementation is causing memory to leak still?

 

Thanks

 

Khafra

Please use plain text.
Contributor
khafra
Posts: 16
Registered: ‎05-17-2011
My Carrier: Bmobile

Re: Still getting "Previous instance still active" using the Webworks 2.3 SDK

I've isolated the offending script :smileyhappy:

 

I was using the API to handle the back key functionality (which worked as intended), somehow even on WW 2.3 SDK it still isnt releasing the back key listener. my code to handle the back key:

 

function trapForBackKey() {
     blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK, handleBack);
}

 

function handleBack() {

 

    if ($("#panel1").css("display")=="none")
   {
      showPanel(document.getElementById('tab1'), 'panel1');
   }
   else
   {
      blackberry.app.exit();
   }

}

 

Of course i would prefer to be able to control the back key without getting the error, but for now i'm leaving it out.

 

Any ideas on how to control the back key and ensure that the listener on the JAVA side gets released?

 

Khafra

Please use plain text.