Monday, 27 October 2014

How a temp variable will cause bugs? 

Let say, An app is using a temp variable (let say block app after 10 failed attempts and each attempt is getting saved in a temporary variable).
In this case if the dev uses temp variable for no.of failed attempts.
After 10 failed attempts accessing to that app will be blocked. Here the magic starts...

  • Killing an app: Typically any app when we kill the app (OS will remove the allocated memory of that app so all the temp variables will be wiped out. Hence the last failed attenmpts will be reset to 0. And now launch the app - Where we can able to access the app. 


  • Restarting a device: If we restarts a device also will kill all the apps and allocated memory (Run time memory) as well. So Once after restarting the device where we can able to access the app. 

No comments:

Post a Comment