Corona Simulator Quits Unexpectedly - Widget Issue?

A few weeks ago, I was using daily build 1032 and my project worked fine in the Simulator and on devices.

 

I hesitated going to newer builds because of the widget changes.  Yesterday, I installed daily build 1056 and ran it in the Simulator and after clicking on one of the buttons, the Simulator quit unexpectedly. 

 

Because of the widget changes, I went through and changed my buttons.

 

Here’s one of my buttons that worked with 1032:

[lua]

 

button1Player1 = widget.newButton{
default = “Assets/Images/button_answer.png”,
over = “Assets/Images/button_answer.png”,
width = 504,
height = 70,
onPress = buttonHandler1Player1,
id = “button1Player1”,
label = setupButtonsButton1,
labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0 } },
font = “MyFont”,
fontSize = buttonTextSize,
yOffset = buttonOffset,
emboss = false

}

 

button1Player1.x = display.contentWidth/2
button1Player1.y = 650

 

button1Player1.isActive = true

[/lua]

 

I changed it to:

[lua]

 

button1Player1 = widget.newButton{
defaultFile = “Assets/Images/button_answer.png”,
overFile = “Assets/Images/button_answer.png”,
width = 504,
height = 70,
onPress = buttonHandler1Player1,
id = “button1Player1”,
label = setupButtonsButton1,
labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0 } },
font = “MyFont”,
fontSize = buttonTextSize,
LabelYOffset = buttonOffset,
emboss = false
}

 

button1Player1.x = display.contentWidth/2
button1Player1.y = 650

 

button1Player1.isActive = true

[/lua]

 

The buttons display fine, but after being clicked, I remove the button from the group like this:

[lua]

 

button1Player1:removeSelf()

button1Player1 = nil

[/lua]

 

I do this after playing an audio track.  The Simulator crashes just after the sound starts playing.  I removed all the audio playback thinking that it might be an audio issue, but even without the audio playback, it still crashes.

 

I tried converting the .isActive over to .isEnabled and :setEnabled() to keep track of which buttons are enabled, but it crashes with the code that way as well.

 

This happened starting with daily build 1034, where the new widgets were introduced.

 

Anyone else having a problem with buttons like this?

 

Anyone have an idea as to what might be causing the buttons to do this?

A few weeks ago, I was using daily build 1032 and my project worked fine in the Simulator and on devices.

 

I hesitated going to newer builds because of the widget changes.  Yesterday, I installed daily build 1056 and ran it in the Simulator and after clicking on one of the buttons, the Simulator quit unexpectedly. 

 

Because of the widget changes, I went through and changed my buttons.

 

Here’s one of my buttons that worked with 1032:

[lua]

 

button1Player1 = widget.newButton{
default = “Assets/Images/button_answer.png”,
over = “Assets/Images/button_answer.png”,
width = 504,
height = 70,
onPress = buttonHandler1Player1,
id = “button1Player1”,
label = setupButtonsButton1,
labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0 } },
font = “MyFont”,
fontSize = buttonTextSize,
yOffset = buttonOffset,
emboss = false

}

 

button1Player1.x = display.contentWidth/2
button1Player1.y = 650

 

button1Player1.isActive = true

[/lua]

 

I changed it to:

[lua]

 

button1Player1 = widget.newButton{
defaultFile = “Assets/Images/button_answer.png”,
overFile = “Assets/Images/button_answer.png”,
width = 504,
height = 70,
onPress = buttonHandler1Player1,
id = “button1Player1”,
label = setupButtonsButton1,
labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0 } },
font = “MyFont”,
fontSize = buttonTextSize,
LabelYOffset = buttonOffset,
emboss = false
}

 

button1Player1.x = display.contentWidth/2
button1Player1.y = 650

 

button1Player1.isActive = true

[/lua]

 

The buttons display fine, but after being clicked, I remove the button from the group like this:

[lua]

 

button1Player1:removeSelf()

button1Player1 = nil

[/lua]

 

I do this after playing an audio track.  The Simulator crashes just after the sound starts playing.  I removed all the audio playback thinking that it might be an audio issue, but even without the audio playback, it still crashes.

 

I tried converting the .isActive over to .isEnabled and :setEnabled() to keep track of which buttons are enabled, but it crashes with the code that way as well.

 

This happened starting with daily build 1034, where the new widgets were introduced.

 

Anyone else having a problem with buttons like this?

 

Anyone have an idea as to what might be causing the buttons to do this?

 

Hi.

 

Do you have a simple test case that reproduces this issue? If so please [buglink]

Sorry, was away.  But yes, I have a simple test case that reproduces it. It still occurs with the new 1064 build as well.

Happens very easily when removing a button and recreating another with the same name.

I will submit a bug.

Bug logged:

(Case 22016) Simulator crashes when removing a button and creating a new one with the same name

A few weeks ago, I was using daily build 1032 and my project worked fine in the Simulator and on devices.

 

I hesitated going to newer builds because of the widget changes.  Yesterday, I installed daily build 1056 and ran it in the Simulator and after clicking on one of the buttons, the Simulator quit unexpectedly. 

 

Because of the widget changes, I went through and changed my buttons.

 

Here’s one of my buttons that worked with 1032:

[lua]

 

button1Player1 = widget.newButton{
default = “Assets/Images/button_answer.png”,
over = “Assets/Images/button_answer.png”,
width = 504,
height = 70,
onPress = buttonHandler1Player1,
id = “button1Player1”,
label = setupButtonsButton1,
labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0 } },
font = “MyFont”,
fontSize = buttonTextSize,
yOffset = buttonOffset,
emboss = false

}

 

button1Player1.x = display.contentWidth/2
button1Player1.y = 650

 

button1Player1.isActive = true

[/lua]

 

I changed it to:

[lua]

 

button1Player1 = widget.newButton{
defaultFile = “Assets/Images/button_answer.png”,
overFile = “Assets/Images/button_answer.png”,
width = 504,
height = 70,
onPress = buttonHandler1Player1,
id = “button1Player1”,
label = setupButtonsButton1,
labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0 } },
font = “MyFont”,
fontSize = buttonTextSize,
LabelYOffset = buttonOffset,
emboss = false
}

 

button1Player1.x = display.contentWidth/2
button1Player1.y = 650

 

button1Player1.isActive = true

[/lua]

 

The buttons display fine, but after being clicked, I remove the button from the group like this:

[lua]

 

button1Player1:removeSelf()

button1Player1 = nil

[/lua]

 

I do this after playing an audio track.  The Simulator crashes just after the sound starts playing.  I removed all the audio playback thinking that it might be an audio issue, but even without the audio playback, it still crashes.

 

I tried converting the .isActive over to .isEnabled and :setEnabled() to keep track of which buttons are enabled, but it crashes with the code that way as well.

 

This happened starting with daily build 1034, where the new widgets were introduced.

 

Anyone else having a problem with buttons like this?

 

Anyone have an idea as to what might be causing the buttons to do this?

 

Hi.

 

Do you have a simple test case that reproduces this issue? If so please [buglink]

Sorry, was away.  But yes, I have a simple test case that reproduces it. It still occurs with the new 1064 build as well.

Happens very easily when removing a button and recreating another with the same name.

I will submit a bug.

Bug logged:

(Case 22016) Simulator crashes when removing a button and creating a new one with the same name