ios - Proper way of preventing GPU access with Core Image when app is in background -


i'm experiencing crashes customers, following backtrace:

0   libgpusupportmercury.dylib          0x3542ae2e gpus_returnnotpermittedkillclient + 10 1   imgsgx543rc2gldriver                0x30bbf5e5 submitpacketsifany + 245 2   glengine                            0x32f827db glfinish_exec + 167 3   coreimage                           0x31fb85b7 ci::glescontext::recursive_render(ci::node const*, cgrect, bool) + 219 4   coreimage                           0x31fbb351 ci::glescontext::render(ci::node*,     cgrect) + 41 5   coreimage                           0x31fc2901 ci::image_get_cgimage(ci::context*, ci::image*, cgrect, cgcolorspace*, ci::pixelformat) + 1313 6   coreimage                           0x31fa8427 -[cicontext createcgimage:fromrect:format:colorspace:] + 487 7   coreimage                           0x31fa81e9 -[cicontext createcgimage:fromrect:] + 89 8   app                                 0x0013c9db -[pztiledimagelayer drawincontext:] (pztiledimagelayer.m:129) 

which due accessing gpu when app in background (not allowed).

the code leading crash this:

if([uiapplication sharedapplication].applicationstate == uiapplicationstateactive) {     cg_image = [self.imagecontext createcgimage:im fromrect:rclip]; } 

this means app changes state after check, before gpu accessing within core image api.

what proper way of handling situation of app background state when using core image api?

if happening on background thread, try moving main thread. way execution of function not interleaved appdelegate callback

- (void)applicationdidenterbackground:(uiapplication *)application 

and can implement signalling there without worrying concurrency.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -