[AC-2565] iOS: Crash with "pointer being freed was not allocated" on certain devices when manually closing windows in a navigation group
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-11T21:28:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | crash, history, ios, navigationGroup |
Reporter | Jacob Avlund |
Assignee | Nikhil Sharma |
Created | 2012-09-12T05:25:47.000+0000 |
Updated | 2016-03-08T07:41:38.000+0000 |
Description
I am experiencing an extremely annoying and somewhat spontaneous bug.
I have a navigation group, and in that navgroup a window with 3 tableviews, each with one or two rows with a label inside. They all lead to new windows opened in that navigation group, loaded with normal CommonJS require statements. Let's call the tableviews T1, T2 and T3.
T1 leads to a window with another tableview, which again leads to yet another tableview. When I click a row here, among other things, the app returns to the initial window. Since the navigation group does not expose its window stack, I have implemented my own history object:
var close = function(win, navGroup) {
'use strict';
if (win.ascendent) {
close(win.ascendent, navGroup);
}
navGroup.close(win);
};
module.exports.close = close;
Now, when I return to the original window, some strange behavior ensues:
- if I click T2 or T3, the app MAY crash - but NEVER in the simulator or on an iPhone 4S (and not on an iPhone 3GS either, it seems). It often does on an iPad or an iPod Touch, though, although it seems to do so only after trying a few times.
- if I click T1, GO BACK via the navigation group, and THEN click T2 or T3, it apparently NEVER crashes.
- if I remove the call to the history object - meaning that I manually backtrack from T1 to the main window - it apparently NEVER crashes.
So, my theory is that it has something to do with manually closing a window by calling navigationgroup.close instead of letting the user press the back button.
If I run the project in XCode, the error I get is "pointer being freed was not allocated". I have attached a symbolicated log for your pleasure.
Let me know if you need more info.
Attachments
By the way, I have not been able to replicate the erroneous behavior in Ti 2.0, so it seems to be introduced recently.
Hi Jacob, Could you please provide a reproducible sample test code?
I've tried, but to no avail, and apparently the behavior seems to be fixed in 2.1.3. I suggest we close this issue.
Fixed in 2.1.3.GA