diff options
Diffstat (limited to 'src/Main.cxx')
-rw-r--r-- | src/Main.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index b4bf99a..6d0a490 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -49,6 +49,7 @@ class Main extends View, Runnable private IDirectFBWindow m_window; private IDirectFBSurface m_surface; private IDirectFBEventBuffer m_events; + private DirectSignalHandler *m_handler; private Source *m_source; @@ -92,6 +93,8 @@ class Main extends View, Runnable /* Initialize DirectFB. */ DirectFB::Init( &argc, &argv ); + direct_signal_handler_add(SIGPIPE, Main::handle_signal, NULL, &m_handler); + if (!m_options.parseCommandLine( argc, argv )) return; @@ -538,6 +541,14 @@ class Main extends View, Runnable else D_ERROR( "IDiVine interface is null!\n" ); } + + public static DirectSignalHandlerResult + handle_signal(int num, void *addr, void *ctx) + { + exit(13); + return DSHR_OK; + } + }; } |