Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19874] ListView - Handling Events on Template Views causing Memory Leak!

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterShawn Lan
AssigneeUnknown
Created2015-08-11T18:49:25.000+0000
Updated2018-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.

Comments

No comments

JSON Source