From 636ced8e1dc8248a1353b416240b93d70ad03edb Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 7 Jul 2013 01:52:51 +0200 Subject: cmdutils: wrap exit explicitly Some C runtime implementations deadlock when calling threading functions on the atexit() handler. Use a simpler wrapper similar to av_log to call the cleanup function before exit. Bug-Id: 523 --- cmdutils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmdutils.h') diff --git a/cmdutils.h b/cmdutils.h index 2372b3f387..997ba1c750 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -44,6 +44,16 @@ extern AVFormatContext *avformat_opts; extern struct SwsContext *sws_opts; extern AVDictionary *format_opts, *codec_opts, *resample_opts; +/** + * Register a program-specific cleanup routine. + */ +void register_exit(void (*cb)(int ret)); + +/** + * Wraps exit with a program-specific cleanup routine. + */ +void exit_program(int ret); + /** * Initialize the cmdutils option system, in particular * allocate the *_opts contexts. -- cgit v1.2.3