612f280208
- Clean up symbol visibility. - Don't force quit in signal handler, since we might double-free things. - Disable reverb flag in modplug decoder. It's producing trash in some cases. - Don't underflow array when parsing timidity config file. - Fix read_config_file() not closing the file when there is an error. - Honor the return code from recursive read_config_file() call. - Reset some state on shutdown to prevent crash when reinitializing. from Brad
51 lines
1.3 KiB
Plaintext
51 lines
1.3 KiB
Plaintext
$OpenBSD: patch-playsound_playsound_c,v 1.1 2012/06/01 15:57:51 ajacoutot Exp $
|
|
|
|
Don't force quit in signal handler, since we might double-free things.
|
|
|
|
--- playsound/playsound.c.orig Fri Jun 1 02:55:31 2012
|
|
+++ playsound/playsound.c Fri Jun 1 02:57:26 2012
|
|
@@ -312,22 +312,11 @@ void sigint_catcher(int signum)
|
|
Uint32 ticks = SDL_GetTicks();
|
|
|
|
assert(signum == SIGINT);
|
|
+ if (done_flag < 0)
|
|
+ return; /* mashing CTRL-C, we get it already. */
|
|
|
|
- if ((last_sigint != 0) && (ticks - last_sigint < 500))
|
|
- {
|
|
- SDL_PauseAudio(1);
|
|
- SDL_CloseAudio();
|
|
- Sound_Quit();
|
|
- SDL_Quit();
|
|
- deinit_archive();
|
|
- exit(1);
|
|
- } /* if */
|
|
-
|
|
- else
|
|
- {
|
|
- last_sigint = ticks;
|
|
- done_flag = 1;
|
|
- } /* else */
|
|
+ done_flag = ((last_sigint != 0) && (ticks - last_sigint < 500)) ? -1 : 1;
|
|
+ last_sigint = ticks;
|
|
} /* sigint_catcher */
|
|
#endif
|
|
|
|
@@ -1050,12 +1039,15 @@ int main(int argc, char **argv)
|
|
Sound_FreeSample(sample);
|
|
|
|
close_archive(filename);
|
|
+
|
|
+ if (done_flag < 0)
|
|
+ break;
|
|
} /* for */
|
|
|
|
Sound_Quit();
|
|
SDL_Quit();
|
|
deinit_archive();
|
|
- return(0);
|
|
+ return((done_flag < 0) ? 1 : 0);
|
|
} /* main */
|
|
|
|
/* end of playsound.c ... */
|