corona icon indicating copy to clipboard operation
corona copied to clipboard

[Simulator]: Crash on display.captureScreen and display.captureBounds on Mac OS simulators

Open alanflickgames opened this issue 1 year ago • 0 comments

On Mac (possibly just M1+ and not Intel Macs) the simulator suddenly crashes when you try to capture the screen. It happens around 75% of the time.

To reproduce you can use either of these in main.lua:

local obj = display.newRect(0, 0, 100, 100)
display.captureBounds({
	        xMin = 0,
	        xMax = 100,
	        yMin = 0,
	        yMax = 100,
	    }  )

or

local obj = display.newRect(0, 0, 100, 100)
display.captureScreen()

It is essentially the same problem as in this solved issue: https://github.com/coronalabs/corona/issues/595

The fix for issue 595 was to add these 2 lines to display.capture after the call to display.CaptureDisplayObject:

    //Rerender and Invalidate to prevent errors on start up
    display.Invalidate();
    display.Render();

I suspect this just needs the same fix to be applied to display.captureScreen and display.captureBounds

alanflickgames avatar Oct 22 '24 10:10 alanflickgames