[TIMOB-19874] ListView - Handling Events on Template Views causing Memory Leak!
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Shawn Lan |
Assignee | Unknown |
Created | 2015-08-11T18:49:25.000+0000 |
Updated | 2018-02-28T19:55:51.000+0000 |
Description
Reference: https://docs.appcelerator.com/platform/latest/#!/guide/Alloy_ListView_Guide-section-40928632_AlloyListViewGuide-HandlingEventsonTemplateViews
Create a default Alloy project with the following:
index.xml
<Alloy>
<Window class="container">
<Label id="label" onClick="doClick">Click Me</Label>
</Window>
</Alloy>
index.js
function doClick(e) {
Alloy.createController("sample").getView().open();
}
$.index.open();
sample.xml
<Alloy>
<Window backgroundColor="white">
<ListView defaultItemTemplate="template">
<Templates>
<ItemTemplate name="template">
<Label onClick="doLabelClick"/>
</ItemTemplate>
</Templates>
</ListView>
<Label onClick="doClick">Close Me</Label>
</Window>
</Alloy>
sample.js
function doLabelClick(){
}
function doClick(){
$.sample.close();
}
Use XCode Instrument to monitor Allocations. Open and Close the sample window. You'll see the sample window view proxies remain in memory. However, if you remove "doLabelClick," this issue is gone. This is a serious problem. Please investigate.
No comments