Our app uses glreadpixels to capture screen on every frame. On iOS 5 devices, when you receive a text message (or any other notification, I assume), the app crashes on the glreadpixels
call.
The crash only happens on iOS 5 with the new style of notifications (the ones that slide down from the top and disappears shortly after). On iOS 4, the old UIAlertView
style notifications work fine.
Specifically, the call to glReadPixels()
throws an EXEC_BAD_ACCESS
error.
The specific call is
glReadPixels(0,0,tx,ty,GL_BGRA_EXT,GL_UNSIGNED_BYTE, buffer);
Where
int tx = 482
int ty = 320
(app is in landscape mode only)
and
GLubyte *buffer = malloc(sizeof(GLubyte)* 4 * tx * ty );
We also tried checking the status of the frame buffer before issuing the read command, glCheckFramebufferStatus(GL_FRAMEBUFFER)
always return GL_FRAMEBUFFER_COMPLETE
.
Is this a bug in how the new notification pop up is implemented? How can we work around it? If we can some how detect that the notification is about to appear, and pause the call to glreadpixels
until it disappears, that would be acceptable as well.
Thanks,
Tim