Forum Libraries, Components, and Plugins

UrhoSharp in Xamarin Android : UrhoSurface destroy blocks UI thread and creates ANR

I am using Urhosharp for animation in my project. I am creating UrhoSurface on button click and destroying it on button back pressed by calling Finish on the activity. It works fine for 5-6 times and after that it doesn't respond to onDestroy. I get to the point where log prints surfaceDestroyed() but nativesurfaceDestroyed doesn't get called . It blocks the UI thread that results in ANR.

// Called when we lose the surface
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.v("SDL", "surfaceDestroyed()"); // this gets called
// Call this before setting mIsSurfaceReady to 'false'
SDLActivity.handlePause();
SDLActivity.mIsSurfaceReady = false;
SDLActivity.onNativeSurfaceDestroyed();// no response here
}

Sign In or Register to comment.