Titanium JIRA Archive
Appcelerator Community (AC)

[AC-418] TiUIView Leaking when being animated on click inside scrollable view.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-11-10T05:53:08.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterYaovi Kwasi
AssigneeMostafizur Rahman
Created2015-08-28T00:55:34.000+0000
Updated2015-11-25T17:21:56.000+0000

Description

TiUIView Leaking when being animated on click inside scrollable view. This does not occur with the 3.4.1 SDK. the animation is the cause of the leak on SDK 3.5.1 above. without animation there is no leak sample code : App.js
var isSet= false;
function doClick() {
        if (!isSet) {
            bt.hide();
            scView.addView(myView);
            isSet = true;
        }
    }
function imageClick() {
        var matrix = Ti.UI.create2DMatrix();
        matrix = matrix.scale(.9, .9);
        animView.animate({
            transform: matrix,
            duration: 100,
            autoreverse: true,
            repeat: 1
        }, function() {
            bt.show();
            _.each(scView.views, function(view) {
                scView.removeView(view);
            });
            isSet = false;
        });
    }

var index  = Ti.UI.createWindow({
        backgroundColor: "white",
        id: "index"
    });
  
var scView = Ti.UI.createScrollableView({
        bottom: 150,
        backgroundColor: "green",
        id: "scView"
    });
   index.add(scView);

var bt = Ti.UI.createButton({
        title: "click here",
        bottom: 100,
        width: 200,
        height: 50,
        color: "red",
        borderWidth: 2,
        id: "bt"
    });
index.add(bt);

bt.addEventListener("click", doClick);

var myView = Ti.UI.createView({
        backgroundColor: "pink",
        id: "myView"
    });
var animView = Ti.UI.createView({
        id: "animView"
    });

myView.add(animView);
animView.add( Ti.UI.createImageView({
        image: "http://www.grandlifestyle.com/images/clickherered.gif",
    }));
animView.addEventListener("click", imageClick);
index.open();
function doClick() {
        if (!isSet) {
            bt.hide();
            scView.addView(myView);
            isSet = true;
        }
    }
function imageClick() {
        var matrix = Ti.UI.create2DMatrix();
        matrix = matrix.scale(.9, .9);
        animView.animate({
            transform: matrix,
            duration: 100,
            autoreverse: true,
            repeat: 1
        }, function() {
            bt.show();
            _.each(scView.views, function(view) {
                scView.removeView(view);
            });
            isSet = false;
        });
    }

var index  = Ti.UI.createWindow({
        backgroundColor: "white",
        id: "index"
    });
  
var scView = Ti.UI.createScrollableView({
        bottom: 150,
        backgroundColor: "green",
        id: "scView"
    });
   index.add(scView);

var bt = Ti.UI.createButton({
        title: "click here",
        bottom: 100,
        width: 200,
        height: 50,
        color: "red",
        borderWidth: 2,
        id: "bt"
    });
index.add(bt);

bt.addEventListener("click", doClick);

var myView = Ti.UI.createView({
        backgroundColor: "pink",
        id: "myView"
    });
var animView = Ti.UI.createView({
        id: "animView"
    });

myView.add(animView);
animView.add( Ti.UI.createImageView({
        image: "http://www.grandlifestyle.com/images/clickherered.gif",
    }));
animView.addEventListener("click", imageClick);
index.open();

Comments

  1. Aminul Islam 2015-11-09

    Hi, I tested the issue you reported.I can't reproduce it. I recommend you upgrade SDK and Studio to the latest build and let us know if you get the error again. *Environment*
       Operating System
         Name                        = Mac OS X
         Version                     = 10.10.5
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       Node.js
         Node.js Version             = 0.10.37
         npm Version                 = 1.4.28
       Titanium CLI
         CLI Version                 = 5.0.5
       Titanium SDK
         SDK Version                 = 5.1.0.v20151104190037
         SDK Path                    = /Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/5.1.0.v20151104190037
         Target Platform             = iphone
       
    Thanks
  2. Yaovi Kwasi 2015-11-25

    Hi I was able to reproduce this with the latest SDK (5.1.1.GA), This happens when there is an object assigned to the {color:red}+*transform property in the animation object*+{color}. animate any view with transform and you will see that it will not be garbage collected. Please fix it.
  3. Yaovi Kwasi 2015-11-25

    Hi I was able to reproduce this with the latest SDK (5.1.1.GA), This happens when there is an object assigned to the {color:red}+*transform property in the animation object*+{color}. animate any view with transform and you will see that it will not be garbage collected. Please fix it.

JSON Source