Timeline: Don't die when not running under NSM.

pull/3/head
Jonathan Moore Liles 2012-02-23 18:55:43 -08:00
parent f15523ea9e
commit d93a2de86b
2 changed files with 10 additions and 6 deletions

View File

@ -150,7 +150,6 @@ namespace NSM
lo_server_thread_stop( _st );
}
int
Client::init ( )
{

View File

@ -106,10 +106,10 @@ shift ( char **argv, int *argc, int n )
extern Timeline *timeline;
void
check_osc ( void * v )
check_nsm ( void * v )
{
nsm->check();
Fl::repeat_timeout( OSC_INTERVAL, check_osc, v );
Fl::repeat_timeout( OSC_INTERVAL, check_nsm, v );
}
static int got_sigterm = 0;
@ -210,6 +210,9 @@ main ( int argc, char **argv )
if ( ! nsm->init() );
{
nsm->announce( nsm_url, APP_NAME, ":progress:switch:", argv[0] );
/* poll so we can keep OSC handlers running in the GUI thread and avoid extra sync */
Fl::add_timeout( OSC_INTERVAL, check_nsm, NULL );
}
}
else
@ -229,19 +232,21 @@ main ( int argc, char **argv )
}
/* poll so we can keep OSC handlers running in the GUI thread and avoid extra sync */
Fl::add_timeout( OSC_INTERVAL, check_osc, NULL );
Fl::add_check( check_sigterm );
Fl::run();
/* cleanup for valgrind's sake */
if ( engine )
{
delete engine;
engine = NULL;
}
delete timeline;
timeline = NULL;
delete tle;
tle = NULL;