Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25257] Windows: Crash when adding tableview back to window

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-11-08T20:42:15.000+0000
Affected Version/sRelease 6.1.2, Release 6.2.0
Fix Version/sRelease 7.0.0
ComponentsWindows
Labelsn/a
ReporterEwan Harris
AssigneeKota Iguchi
Created2017-09-08T14:25:07.000+0000
Updated2017-11-17T01:36:11.000+0000

Description

Description

*The original Android ticket that this test came from was related to searchbar but this occurs when the searchbar isn't added too, when testing please ensure both (with searchbar and without searchbar) are exercised* When adding a tableview back to a windows after removing it the app will freeze and crash
var _window = Ti.UI.createWindow();
var flag = false;
var data = [{
    title: 'Row 1',
    hasChild: true,
    color: 'red',
    header: 'First'
}, {
    title: 'Row 2',
    hasDetail: true,
    color: 'green'
}, {
    title: 'Row 3',
    hasCheck: true,
    color: 'blue',
    header: 'Second'
}, {
    title: 'Row 4',
    color: 'orange'
}];

var sb = Titanium.UI.createSearchBar({
    barColor: '#122a6f',
    showCancel: false,
    height: 44,
});

// Create a TableView.
var table = Ti.UI.createTableView({
    height: 600,
    width: '100%',
    search: sb,
    top: 75,
    left: 0,
    data: data
});

_window.add(table);

var button = Ti.UI.createButton({
    title: 'Show / Hide',
    height: 75,
    width: '100%',
    top: 0,
    left: 0
});

_window.add(button);
button.addEventListener('click', function() {
    if (true == flag) {
        _window.add(table);
        flag = false;
    } else {
        _window.remove(table);
        flag = true;
    }
});
_window.open()

Steps to reproduce

Add the above code to an existing app.js

Tap the button at the top

Tap the button again

Actual

TableView is removed on first click, app freezes and crashes on second click

Expected

TableView is removed on first click, readded on second click

Comments

  1. Kota Iguchi 2017-10-03

    https://github.com/appcelerator/titanium_mobile_windows/pull/1129
  2. Abir Mukherjee 2017-11-17

    Tested on SDK 7.0.0.v20171116132144 installed from CLI. Fix is verified.

JSON Source