Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25487] Android: Prevent kroll from removing null proxy object pointer #9587

Merged
merged 1 commit into from Nov 7, 2017

Conversation

garymathews
Copy link
Contributor

  • There is no null object reference check when removing a proxy object pointer, causing a crash on garbage collection
TEST CASE
  • Repeatedly view and back-out from the map until crash
  • This will be re-producible in other cases, but can consistently be reproduced with ti.map due to its heavy memory usage
var MapModule = require('ti.map'),
    win = Titanium.UI.createWindow({backgroundColor: 'gray'}),
    btn = Ti.UI.createButton({title: 'VIEW MAP'});

function viewMap () {
    var win = Ti.UI.createWindow({backgroundColor: 'gray'}),
        mapView = MapModule.createView({
            userLocation: true,
            mapType: MapModule.NORMAL_TYPE,
            animate: true,
            region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }
        });
    win.add(mapView);
    win.open();
}

btn.addEventListener('click', function (e) {
	if (Ti.Geolocation.hasLocationPermissions()) {
        viewMap();
    } else {
        Ti.Geolocation.requestLocationPermissions(function (e) {
            if (e.success === true) {
                viewMap();
            } else {
                alert('permissions denied: ' + e.error);
            }
        });
	}
});

win.add(btn);
win.open();

JIRA Ticket

@sgtcoolguy sgtcoolguy merged commit ed7a2b7 into tidev:master Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants