Thanks, I posted the screenshot since it contains the error information which might help understanding the problem.
BTW, that surfaceObj was from callback block of
CGDisplayStreamCreateWithDispatchQueue, and its value is not null but not sure if it is valid.
auto dspref = CGDisplayStreamCreateWithDispatchQueue(
displayId,
captureWidth,
captureHeight,
'420v',
opts,
dispatch_queue_create("my_display_data", DISPATCH_QUEUE_SERIAL),
^( CGDisplayStreamFrameStatus status, uint64_t time, IOSurfaceRef surfaceObj, CGDisplayStreamUpdateRef ref )
{
'
Do we have any API to check if it is valid to avoid crash?
Do we need release this surfaceObj after sent out the XPC message? I suppose system do the maintenance job for the callback block.
Again, ARC was disabled.
-Steven