Fixed crash on exit under Android.