| View previous topic :: View next topic |
| Author |
Message |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Tue Nov 25, 2008 3:58 am Post subject: atexit does not work |
|
|
| I tried to use the stdlib function at exit so that it would save settings when yes on the homescreen is pressed and i couldnt get it to work i even added exit(EXIT_SUCCESS) in to the exit callback then it just crashes how can i get this to work so far my program calls osl_quit = 1; and sceKernelExitGame() in the exit_callback but if i try to call the function directly the psp crashes if i call exit() it crashes so what am i to do and if i have it save in the main after osl_quit = 1 then it doesnt even get called cause it doesnt reach it |
|
| Back to top |
|
 |
Badboy_
Joined: 09 Aug 2008 Posts: 4
|
Posted: Tue Nov 25, 2008 5:41 am Post subject: |
|
|
| put your save_settings call in the exit callback... |
|
| Back to top |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Tue Nov 25, 2008 8:24 am Post subject: |
|
|
| tried that it crashes the psp when i do so |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Tue Nov 25, 2008 1:20 pm Post subject: |
|
|
| Sounds more like one of the exit functions is crashing. You might try putting debug prints in them and see how far it gets. |
|
| Back to top |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Sat Nov 29, 2008 3:58 am Post subject: |
|
|
| i got it to work my main has to return 0 for it to work |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sat Nov 29, 2008 6:21 am Post subject: |
|
|
| coolkehon wrote: | | i got it to work my main has to return 0 for it to work |
Ah... a lot of people think that because the PSP has its own exit function, they don't need to return something from main()... I do it anyway to suppress the warning, but I guess it really is needed. :) |
|
| Back to top |
|
 |
coolkehon
Joined: 20 Oct 2008 Posts: 355
|
Posted: Sat Nov 29, 2008 7:29 am Post subject: |
|
|
no i had it return one before but it was never reached because sceKernelExitGame was called before return 0;
| Code: | int main(whatever)
{
sceKernelExitGame();
return 0;
} |
|
|
| Back to top |
|
 |
|