[Bug]Crash When Iterating Over Global Table

Forum to report bugs for SDStudio Design Environment
Post Reply
Centauri Soldier
Registered User
Posts: 32
Joined: Fri Aug 30, 2013 5:45 pm

[Bug]Crash When Iterating Over Global Table

Post by Centauri Soldier »

Occasionally, when I try to iterate through a global table (which was declared in Globals), I get an error: bad arguement #1 to 'for iterator' (table expected, got nil);

Now, I know for a fact that this table is not nil, it is set once and never changes. But, sometimes, the program runs fine and other times it gives this error. On the times when it gives the error, I click the bebug error (presumably to open the section where the error occured) and SDStudio crashes.

It seems to happen more often if I have edited Globals recently.

EDIT: Okay, I've narrowed down a little further,

I've got a combo box called cmb_classes. The combobox is set to autosort.

In the OnCreate event of my window I have this code.

Code: Select all

ComboBox:DeleteAllItems(cmb_classes);
ComboBox:DeleteAllItems(cmb_types);

for sClass, tTypes in pairs(_tClassAndTypes) do
	ComboBox:AddItem(cmb_classes, sClass, "");
end
Now, sometimes when I start my program, the combobox is autosorted and sometimes it is not (this is unexpected behaviour). Whether or not it is autosorted is totally random. Whenever it does get sorted, I get the error and the subsequent crash. Whenever it does not get sorted, everything works fine.
User avatar
Serkan
Developer
Developer
Posts: 206
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan »

Can you please share a simple demo of the project that you experience the issues
Centauri Soldier
Registered User
Posts: 32
Joined: Fri Aug 30, 2013 5:45 pm

Post by Centauri Soldier »

I'm sorry, I cannot. I can tell you how to replicate the behaviour though. If you require an external file which has an error, try to click on the debug link and the program will often crash.
Centauri Soldier
Registered User
Posts: 32
Joined: Fri Aug 30, 2013 5:45 pm

Post by Centauri Soldier »

Nevermind this thread, you offered a solution in another thread regarding Application.LoadFile in the next update.
Post Reply