[TIMOB-23711] iOS: Incrementing instances of "Window is not open Ignoring this close call" on win.close()
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2016-08-02T15:44:10.000+0000 |
| Affected Version/s | Release 5.4.0 |
| Fix Version/s | n/a |
| Components | n/a |
| Labels | qe-5.4.0 |
| Reporter | Harry Bryant |
| Assignee | Hans Knöchel |
| Created | 2016-08-01T17:43:35.000+0000 |
| Updated | 2016-08-02T16:38:32.000+0000 |
Description
*This does not occur with 5.3.1.GA*
when opening and closing the window a couple of times, I receive the following DEBUG log:
[DEBUG] : Window is not open. Ignoring this close call
The log count is incremented every time I cycle through Open / Close. For example after 5 cycles I receive the following:
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
[DEBUG] : Window is not open. Ignoring this close call
( 1 + 2 + 3 + 4 + 5 )
TEST CODE
Ti.UI.backgroundColor = "Black";
var win = Ti.UI.createWindow({backgroundColor:'blue'});
var open = Ti.UI.createButton({
title: 'Open Window'
});
var close = Ti.UI.createButton({
title: 'Close Window'
});
open.addEventListener('click', function(){
var win2 = Ti.UI.createWindow({backgroundColor:'green'});
win2.add(close);
close.addEventListener('click', function(){
win2.close();
});
win2.open();
});
win.add(open);
win.open();
Steps to Reproduce
1. Create a new Classic Mobile Project. 2. Copy above test code into app.js file. 4. Run App to device / sim. 5. Click on "Open Window" button. 6. Click on "Close Window" button. 7. Repeat Steps 5-6 to receive the log messageActual Result
Incrementing count of[DEBUG] : Window is not open. Ignoring this close call
Expected Result
[DEBUG] : Window is not open. Ignoring this close call only when relevant, and should not increment every cycle.
I'm wondering if that could be related to the event-listeners inside the event-listener causing. But as you're saying it didn't happen in 5.3.1.GA, it's making me unsure. *EDIT*: The
closebutton is defined outside the scope, I'm 80 % sure that's the problem here. That would also explain, why the sum of logs (1+2+3+4+5) is as it is, because the existing event-listeners are still being triggered because they are scoped to theclosebutton outside the click-event. *EDIT2*: And the reason why it isn't logged in 5.3.1.GA may be, because the log is only thrown when using main-thread. *EDIT3*: Not reproducible anymore using the correct demo-code following here:[~htbryant] Please verify and close, thanks!var win = Ti.UI.createWindow({backgroundColor:'blue'}); var open = Ti.UI.createButton({ title: 'Open Window' }); open.addEventListener('click', function(){ var win2 = Ti.UI.createWindow({backgroundColor:'green'}); var close = Ti.UI.createButton({ title: 'Close Window' }); win2.add(close); close.addEventListener('click', function(){ win2.close(); }); win2.open(); }); win.add(open); win.open();Resolving as invalid for now, [~htbryant] to confirm.
Can confirm that the issue was the
closebutton being defined outside of the scope. Closing as Invalid.