Search Issue Tracker
By Design
Votes
1
Found in
4.6.8p3
Issue ID
732663
Regression
Yes
[IMGUI] Crash when calling GUILayout.Button on iOS devices in Unity 4.6 builds
Reproduction steps:
1. Open attached project "IMGUIButtonCrash"
2. Build scene "scene1" for iOS
3. Start the game
- You should see an input field
4. Type in at least 10 characters
- Game crashes
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Material does not update when setting an enum keyword using EnableKeyword
- AddComponentMenu.componentOrder has no effect on the "Add Component" menu in the Inspector window
- Distant objects become visibly illuminated when looking through the volumetric fog with SSGI enabled
- WebGL build crashes when opening a ZipArchive entry and "Code Optimization" is not set to the default "Shorter Build Time"
- Severe visual artifacts happen in the Editor when using GrassFlow package assets with Compute Shader
jesusluvsyooh
Oct 02, 2015 21:53
This may sound strange, but i found the cause of bug Case 732663, its the
inputField.Length>=2
On the script called fontios, line 70 in the repo project.
Did a bit of trial and error on the repo project to try narrow it down, removing or moving the inputfield length check stops the crash and everything works fine.
Removed/moved it on my main project and that now works fine too.
I have the same "inputField.Length>=2" on various other scripts and projects and they do not crash, so still needs investigating further.
Original (crashes)
[code=JavaScript]if(waited && inputField.length >= 2 )
{
if ((Event.current.type == EventType.keyDown && Event.current.character == "\n") || (GUILayout.Button("send", GUILayout.Width(35*heightScale), GUILayout.Height(35*heightScale)) ))
{
ApplyGlobalChatText("user 1" + ": " + inputField, 0);
inputField = "";
ButtonWait ();
}
}[/code]
Also crashed (moved input length check into if statement below)
[code=JavaScript]if(waited )
{
if ( inputField.length >= 2 && ((Event.current.type == EventType.keyDown && Event.current.character == "\n") || (GUILayout.Button("send", GUILayout.Width(35*heightScale), GUILayout.Height(35*heightScale)) )) )
{
ApplyGlobalChatText("user 1" + ": " + inputField, 0);
inputField = "";
ButtonWait ();
}
}[/code]
Does not crash (moved input check after button and keydown event)
[code=JavaScript]if(waited )
{
if (((Event.current.type == EventType.keyDown && Event.current.character == "\n") || (GUILayout.Button("send", GUILayout.Width(35*heightScale), GUILayout.Height(35*heightScale)) ))) && inputField.length >= 2)
{
ApplyGlobalChatText("user 1" + ": " + inputField, 0);
inputField = "";
ButtonWait ();
}
}[/code]
If you could pass this message and information on to those in charge of that area, hopefully it will shed some light on the matter.
jesusluvsyooh
Oct 02, 2015 18:16
:D this is my bug