Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7246] iOS - Window Proxy does not get release if animated with callback

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-12-17T06:47:06.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-02, Release 2.0.0, Release 1.8.1, Release 3.5.0, Release 4.0.0
ComponentsiOS
Labelsmodule_memory, qe-3.5.0, qe-manualtest, regression
ReporterPedro Enrique
AssigneeVishal Duggal
Created2012-01-16T18:50:39.000+0000
Updated2015-01-02T09:30:53.000+0000

Description

The Problem:

A window that has some type of animation with a callback function leaks.

Test case

Open instruments and look for proxies while opening and closing the window in the following code sample:

Code

function Window1(){
	var self = {};
	
	var win =  Ti.UI.createWindow();
	var btn =  Ti.UI.createButton({
		title:'open',
		left:20,
		right:20,
		height:44
	});

	btn.addEventListener('click', function(){
		Window2().open();
	});

	win.add(btn);
	self.open = win.open;
	self.close = win.close;
	return self;
}

function Window2(){
	var self = {};
	
	var win = Ti.UI.createWindow({
		backgroundColor:'green'
	});
	// win.addEventListener('close', function(){
	// 	win = null; // this will make the window go away from memory, but not the items within
	// });
	win.addEventListener('open', function(){
		win.animate({
			left:10,
			duration:300
		}, function(){
			Ti.API.info('complete');
		});
	});
	var btn =  Ti.UI.createButton({title:'close', left:20,right:20,height:44});
	btn.addEventListener('click', function(){
		win.close();
	});
	win.add(btn);
	
	self.open = win.open;
	self.close = win.close;
	return self;
}

Window1().open();

Comments

  1. Eric Merriman 2012-01-23

    Reopening to add labels and closing comment
  2. Eric Merriman 2012-01-23

    Verified fixed with SDK 1.9.0.v20120121223134 on iPhone 4s (5.0.1).
  3. Wilson Luu 2012-01-31

    updated labels
  4. Kajenthiran Velummaylum 2014-12-04

    Reopening the ticket as it's leaking in 3.5.0 SDK While testing with Xcode instruments, # Persistent value never goes down. This is a *regression* as it's working fine in 3.4.1 release. Test Environment: Titanium SDK: 3.5.0.v20141202100219 Appc-Studio: 3.4.1 GA Titanium CLI: 3.4.1 GA Alloy : 1.5.1 GA Xcode : 6.1 OS: OSX 10.10.1 Device : iPhone 6plus (iOS 8.1)
  5. Khushbu Agrawal 2014-12-05

    Had seen the same issue. If the window has some type of animation with a callback function then its leaking. Without Animation, its work fine.
  6. Vishal Duggal 2014-12-16

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/6488 3_5_X - https://github.com/appcelerator/titanium_mobile/pull/6489
  7. Chee Kiat Ng 2014-12-17

    CR and FT Passed. Both pull requests merged.
  8. Kajenthiran Velummaylum 2015-01-02

    Verified the fix and hence closing the ticket. Test Environment: Titanium SDK: 3.5.0.v20141222103320 Appc-Studio: 3.4.1 GA Titanium CLI: 3.4.1 GA Alloy : 1.5.1 GA Xcode : 6.1 OS: OSX 10.10.1 Device : iPhone 6plus (iOS 8.1)

JSON Source