Commit 74258e6c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Call libvlc_set_exit_handler() first

It should be called before exit can happen.
This restores reverted commit 4d636fa3.
parent 4e1d5325
......@@ -166,6 +166,7 @@ int main( int i_argc, const char *ppsz_argv[] )
sigaddset (&set, SIGCHLD);
/* Block all these signals */
pthread_t self = pthread_self ();
pthread_sigmask (SIG_SETMASK, &set, NULL);
const char *argv[i_argc + 2];
......@@ -193,6 +194,7 @@ int main( int i_argc, const char *ppsz_argv[] )
if (vlc == NULL)
goto out;
libvlc_set_exit_handler (vlc, vlc_kill, &self);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
#if !defined (HAVE_MAEMO) && !defined __APPLE__ && !defined (__OS2__)
......@@ -207,10 +209,6 @@ int main( int i_argc, const char *ppsz_argv[] )
libvlc_playlist_play (vlc, -1, 0, NULL);
/* Wait for a termination signal */
pthread_t self = pthread_self ();
libvlc_set_exit_handler (vlc, vlc_kill, &self);
/* Qt4 insists on catching SIGCHLD via signal handler. To work around that,
* unblock it after all our child threads are created. */
sigdelset (&set, SIGCHLD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment