rococoa

Invalid memory access of location with Rococoa

对着背影说爱祢 提交于 2019-12-08 03:56:10
问题 I've been trying to code a simple screenshot application using rococoa (java to osx cocoa api library), and managed to get as far as actually taking the screenshot, and then saving it to a file. Unfortunately, once in a while, the application fails with an 'Invalid memory access of location...' error. I'm assuming this is due to something being garbage collected, because I'm failing to keep a reference alive. The line that is causing the crash is: int[] data = pointer.getIntArray(0,