widget.lua:30 crash

I have crash reports that end with :

=> widget.lua:30: attempt to index field ‘?’ (a nil value)

widget/widgetLibrary/widget.lua:30: in function ‘removeWidgets’
widget/widgetLibrary/widget.lua:35: in function ‘removeWidgets’
widget/widgetLibrary/widget.lua:47: in function ‘removeSelf’

?: in function ‘removeXGroup’

  • I am not using custom widget.lua

  • I was not able to reproduce on my devices.

  • crash is exclusive to android platform ( what can explain this ? )

  • crashes happen while removing a group of display objects ( non of them is widget )

  • removeWidgets is called anyway even for display objects, that’s how Corona guys implemented it.

looking at widget.lua posted in github, all crashes happen at line “30”

At line 30 group[i] is nil

 -- Function to find/remove widgets within group local function removeWidgets( group ) if group.numChildren then for i = group.numChildren, 1, -1 do if group[i].\_isWidget then group[i]:removeSelf() elseif not group[i].\_isWidget and group[i].numChildren then -- Nested group (that is not a widget) removeWidgets( group[i] ) end end end end

Anybody faced this before ?

 

What version of Corona SDK are you running?

Rob

2016.2892

It’s not specific to this version, it happened in previous versions as well.

We made changes to removing objects in a scrollView with build 2894. You might want to consider updating to a more recent version (2905 is the latest daily build).

Rob

I’m removing normal display groups not even widgets

 for i = group.numChildren, 1, -1 do if group[i].\_isWidget then

Did you recently fix / found something that caused a crash in these lines in widget.lua ?

somehow group[i] is nil for some i that is less than group.numChildren !

In 2894, we made changes to how scrollViews are removed. It’s very likely that change could be in widget.lua. That fix was to address problems like this. Please update to 2906 (today’s daily build) and try again.

If it’s still a problem with 2906, let me know.

Rob

What version of Corona SDK are you running?

Rob

2016.2892

It’s not specific to this version, it happened in previous versions as well.

We made changes to removing objects in a scrollView with build 2894. You might want to consider updating to a more recent version (2905 is the latest daily build).

Rob

I’m removing normal display groups not even widgets

 for i = group.numChildren, 1, -1 do if group[i].\_isWidget then

Did you recently fix / found something that caused a crash in these lines in widget.lua ?

somehow group[i] is nil for some i that is less than group.numChildren !

In 2894, we made changes to how scrollViews are removed. It’s very likely that change could be in widget.lua. That fix was to address problems like this. Please update to 2906 (today’s daily build) and try again.

If it’s still a problem with 2906, let me know.

Rob