Crash when arrays are set to empty

Monkey Forums/Monkey Programming/Crash when arrays are set to empty

Rus(Posted 2012) [#1]
I've run into a bug with the arrays. Can you guys test this on the GLFW target. I've only seen it there so far. Run the following code, then click out of the app, wait a bit, then click back in. I get a 'Memory access violation' crash every time. I don't see anything similar with Lists.

The Print Millisecs() line is there so I can see that the App is running. You can remove it and it will still crash.

If I can get a confirmation, then I'll send this over to Bug Reports.

I'm running Monkey v53.

Strict
Import mojo

Global ArrayTest:CustomData[]

Class Game Extends App
	Method OnCreate:Int()
		SetUpdateRate(60)
		ArrayTest = []
		Return 0
	End
	
	
	Method OnUpdate:Int()
		ArrayTest = []
		Return 0
	End
	
	
	Method OnRender:Int()
		Cls
		Print Millisecs()
		Return 0
	End
End


Function Main:Int()
	New Game
	Return 0
End

Class CustomData
	Field i:Int
	Field j:String
End




Samah(Posted 2012) [#2]
Crashes for me too. System specs in sig.