Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6713] Android: Timers are not being cancelled when onDestroy() is called.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-04-11T22:52:27.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-50, Release 1.8.0.1, Release 2.0.0
ComponentsAndroid
Labelsmodule_titanium, parity, qe-3.2.3, qe-testadded, regression, verified-1.8.0.1
ReporterJosh Roesslein
AssigneeHieu Pham
Created2011-12-15T17:16:22.000+0000
Updated2014-04-11T22:52:27.000+0000

Description

Expected: After hitting "back" button to leave the application and trigger a destroy, the timer should stop running and no more messages should be logged. Actual: Timer continues to run logging out messages.
setInterval(function () {
  Ti.API.info("Beep.");
}, 1000);

Comments

  1. Wilson Luu 2011-12-19

    Verified fix on: SDK build: 1.8.0.1.RC3 Runtime: V8, Rhino Titanium Studio, build: 1.0.7.201112152014 OS: Mac OS X Lion Device: Nexus S (2.3.6) Note: Did not verify fix on 1.9.0 yet; will not close bug.
  2. Wilson Luu 2012-01-11

    Closing bug. Already verified fix on 1.8.0.1
  3. Olga Romero 2014-04-09

    Reopened: Appcelerator Studio, build: 3.2.3.201404081806 Titanium SDK, build: 3.2.3.v20140403105720 Node.JS Version: v0.10.13 NPM Version: 1.3.2 ├── acs@1.0.14 ├── alloy@1.3.1 ├── node-appc@0.2.0 ├── npm@1.3.2 ├── titanium@3.2.3-alpha2 └── titanium-code-processor@1.1.1-alpha Devices: GalaxyS4 Android version 4.2.2 Nexus7 Android version 4.3
       [INFO] :   Beep.
       [INFO] :   Beep.
       [INFO] :   Beep.
       [INFO] :   Beep.
       [DEBUG] :  Window: Window is closed normally.
       [INFO] :   Beep.
       [INFO] :   Beep.
       [INFO] :   Beep.
       
    Timers are not being cancelled after Back button is pressed.
  4. Hieu Pham 2014-04-10

    I'm unable to reproduce this. Seems to work fine with latest master and 3.2.x branch.
  5. Lokesh Choudhary 2014-04-11

    Timers are being cancelled as expected when the app is closed. Environment: Appc Studio : 3.2.3.201404111117 Ti SDK : 3.2.3.v20140403105720 Mac OSX : 10.8.5 Alloy : 1.3.1 CLI - 3.2.3-alpha2 Samsung Galaxy S4 running android 4.2.2
  6. Lokesh Choudhary 2014-04-11

    Reopening to edit comment.
  7. Lokesh Choudhary 2014-04-11

    Closing

JSON Source