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

This commit is contained in:
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 ); lo_server_thread_stop( _st );
} }
int int
Client::init ( ) Client::init ( )
{ {

View File

@ -106,10 +106,10 @@ shift ( char **argv, int *argc, int n )
extern Timeline *timeline; extern Timeline *timeline;
void void
check_osc ( void * v ) check_nsm ( void * v )
{ {
nsm->check(); nsm->check();
Fl::repeat_timeout( OSC_INTERVAL, check_osc, v ); Fl::repeat_timeout( OSC_INTERVAL, check_nsm, v );
} }
static int got_sigterm = 0; static int got_sigterm = 0;
@ -210,6 +210,9 @@ main ( int argc, char **argv )
if ( ! nsm->init() ); if ( ! nsm->init() );
{ {
nsm->announce( nsm_url, APP_NAME, ":progress:switch:", argv[0] ); 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 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::add_check( check_sigterm );
Fl::run(); Fl::run();
/* cleanup for valgrind's sake */
if ( engine ) if ( engine )
{ {
delete engine; delete engine;
engine = NULL; engine = NULL;
} }
delete timeline;
timeline = NULL;
delete tle; delete tle;
tle = NULL; tle = NULL;