Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24096

iOS: Removing webviews from parent views crashes app

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Not Our Bug
    • Affects Version/s: Release 5.5.1
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Environment:
    • Story Points:
      5
    • Sprint:
      2016 Sprint 23 SDK

      Description

      When navigating from a view back to another view, if you try and remove a webview from the view you are leaving, the app freezes and then eventually crashes.

      Test Case:

      index.js
       
      var testView = Ti.UI.createView({
      	layout: 'vertical',
      	backgroundColor: '#FFF'
      });
      var button1 = Ti.UI.createButton({
      	height: 50,
      	width: 100,
      	backgroundColor: '#00FF00',
      	color: '#FFF',
      	top: 50, 
      	title: 'Get View'
      });
       
      var firstView = Ti.UI.createView({
      	backgroundColor: '#CFCFCF'
      });
       
      var button2 = Ti.UI.createButton({
      	backgroundColor: '#000',
      	color: '#FFF',
      	height: 50,
      	width: 100,
      	title: 'Get WebView'
      });
       
      var secondView = Ti.UI.createView();
       
      var button3 = Ti.UI.createButton({
      	backgroundColor: '#0000FF',
      	color: '#FFF',
      	height: 50,
      	width: 100,
      	top: 60,
      	title: 'Go Back'
      });
       
      button3.addEventListener( 'click', function( e ) {
      	var items = firstView.children;
      	
      	for( var i = 0; i<=items.length; i++ ){
      		firstView.remove( items[ i ] );
      		items[ i ] = null;
      	}
      });
       
      var webView = Ti.UI.createWebView({
      	height : Titanium.UI.SIZE,
      	width : '100%',
      	top: 20,
      	contentHeight : Ti.UI.SIZE,
      	bottom : 0,
      	font : Alloy.CFG.FONT_14,
      	color : '#666',
      	ignoreSslError : true,
      	html: '<b>This is only a test. Do not be alarmed.</b>'
      });
       
      secondView.add(webView);
      secondView.add(button3);
       
      button2.addEventListener( 'click', function( e ) {
      	firstView.add(secondView);
      });
       
      firstView.add( button2 );
       
      button1.addEventListener( 'click', function( e ) {
      	testView.add( firstView );
      });
      testView.add( button1 );
       
      $.index.add( testView );
       
      $.index.open();
      

      Process to create bug:

      1) Click 'Get View' button
      2) Click 'Get WebView' button
      3) Click 'Go Back' button
      4) Now, click 'Get View' button again and app will freeze and then eventually crash.

      I cannot reproduce this issue on Android, only iOS.

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              Uhlig Uhlig Mobile
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-10246
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration