{ "id": "61283", "key": "TIMOB-651", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11222", "name": "Release 1.2.0", "archived": true, "released": true, "releaseDate": "2010-04-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:53:48.000+0000", "created": "2011-04-15T02:33:46.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:53:48.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
get this
\n2010-03-26 11:46:28.667 TwitterUI[51108:530b] *** Terminating\napp due to uncaught exception 'NSInternalInconsistencyException',\nreason: 'stopAudioSession called too many times'
\nseems to be a problem with the guard.
\nrun attached app (click button on page1, then click row on table\nview, close modal, repeat -> crash)
Claimed from Blain. My previous description of the bug was\nerroneous.
This appears to be a much more serious issue. Stack traces\nindicate the following:
\nCreation: (count = 1)
\n0: -[TiMediaAudioSession startAudioSession]
\n1: -[TiMediaAudioPlayerProxy initWithProperties:]
\n2: -[TiProxy initWithPageContext:args:]
\n3: -[TiModule createProxy:forName:context:]
With the following when the tab (NOT the modal window!) are\nclosed:
\nDestruction:
\nOnce for context destruction: (count = 0)
\n1: -[TiMediaAudioSession stopAudioSession]
\n2: -[TiMediaAudioPlayerProxy _destroy]
\n3: -[TiProxy contextShutdown:]
And once for the proxy destruction: (count = -1)
\n1: -[TiMediaAudioSession stopAudioSession]
\n2: -[TiMediaAudioPlayerProxy _destroy]
\n3: -[TiProxy dealloc]
The solution is to perform a sanity check on (count), but please\nbe aware of the larger issue: All destroy functions MUST\nRELEASE_TO_NIL() all variables and/or perform operations which are\nguaranteed to have NO side-effects in other classes (in this case,\nTiMediaAudioPlayerProxy calls a function with a side-effect in\nanother class: TiMediaAudioSession.) If they must call functions\nwith side-effects, there should be a 'BOOL destroyed' variable\nwhich tracks whether or not the object has already been destroyed.\n(ED'S NOTE: Calling [super destroy] in the appropriate place\nhandles this already; ignore my advice.)
\nStrongly recommend that this variable (and a sanity check\nassociated with it) be added to TiProxy.
Well I'll be - there's already this variable (and an associated\nsanity check!) in _destroy for TiProxy.
\nThe problem was that [super _destroy] was not called. Fixed.
(from [31b5596dc6480e8f6e753a48949505706e7a2f2a])\nCloses #651 - Didn't call [super _destroy]. \nhttp://github.com/appcelerator/titanium_mobile/commit/31b5596dc6480...