Afer SDL_Quit, we see the core dump in android

HI all,

I am not sure if this is the right approach to shutdown: When OnDestroy hapenning from the java side,
i invoke the below functions:

propershutdown ()
{
SDL_Quit();
exit (0);

};

but after some time i get the core dump on .

03-18 19:50:46.411: A/libc(30038): heap corruption detected by dlmalloc
03-18 19:50:46.412: A/libc(30038): Fatal signal 6 (SIGABRT) at 0x00007556 (code=-6), thread 30071 (SDLThread)

Is it the right way to do Quit

I haven’t touch the Java side myself (other than to load additional SDL libraries and Intent handling). I am using the android-project/ as the base. I
exit the app in much the same way except in my main() I “return 0” (after calling SDL_Quit). Are you using the android-project/ or something else?

Out of curiosity, try ‘_exit(0)’ instead of ‘exit(0)’. ‘_exit()’ terminates the program immediately where as exit(0) does a “normal” termination.

AlvinOn 18/03/14 11:29, keestu wrote:

HI all,

I am not sure if this is the right approach to shutdown: When OnDestroy hapenning from the java side,
i invoke the below functions:

propershutdown ()
{
SDL_Quit();
exit (0);

};

but after some time i get the core dump on .

03-18 19:50:46.411: A/libc(30038): heap corruption detected by dlmalloc
03-18 19:50:46.412: A/libc(30038): Fatal signal 6 (SIGABRT) at 0x00007556 (code=-6), thread 30071 (SDLThread)

Is it the right way to do Quit

Message-ID: <1395152971.m2f.42689 at forums.libsdl.org>
Content-Type: text/plain; charset=“iso-8859-1”

HI all,

I am not sure if this is the right approach to shutdown: When OnDestroy hapenning from the java side,
i invoke the below functions:

propershutdown ()
{
SDL_Quit();
exit (0);

};

but after some time i get the core dump on .

03-18 19:50:46.411: A/libc(30038): heap corruption detected by dlmalloc
03-18 19:50:46.412: A/libc(30038): Fatal signal 6 (SIGABRT) at 0x00007556 (code=-6), thread 30071 (SDLThread)

Is it the right way to do Quit

To be honest, the “right way to quit on Android” is probably to not
quit unless Android tells you to. Instead, fall back to a boring,
low-resource “click button to load” screen, or something similar.
Mobile OSes (and this will presumably expand to desktops over time)
generally expect the programs that they run to be sitting inactive in
memory, ready to resume when told: after all, the memory is normally
going to be running anyways, and if the OS is going to go into
hibernation then it’s perfectly capable of notifying the apps that’re
running and inactive alike to finish shutting down.

So: unless Android tells you to quit, don’t quit. Just release your
resources, and wait for an event that tells you either to restart, or
to finish shutting down.> Date: Tue, 18 Mar 2014 14:29:31 +0000

From: “keestu”
To: sdl at lists.libsdl.org
Subject: [SDL] Afer SDL_Quit, we see the core dump in android.

Thanks for the reply. The error was somewhere in the another SDL thread, and once i resolve that, this Core dump issue disappeared.