fixed segfault at exit on android