diff options
author | Franz Zotter <fzotter@users.sourceforge.net> | 2006-03-25 10:53:13 +0000 |
---|---|---|
committer | Franz Zotter <fzotter@users.sourceforge.net> | 2006-03-25 10:53:13 +0000 |
commit | 47979e4af5ff135984a22d5ecb6ef7acb69f6f0f (patch) | |
tree | 5f257186a91ef7fe04622a7bac090c56b68cadc5 | |
parent | 01dc32c7fb1c4d5ce0022b3b77ceba4cc1341e58 (diff) |
objects cannot be created when pdoctave is not present
svn path=/trunk/externals/iem/pdoctave/; revision=4765
-rw-r--r-- | pdoctave_command.c | 3 | ||||
-rw-r--r-- | pdoctave_get.c | 9 | ||||
-rw-r--r-- | pdoctave_send.c | 8 |
3 files changed, 14 insertions, 6 deletions
diff --git a/pdoctave_command.c b/pdoctave_command.c index b1f1d6b..de4135a 100644 --- a/pdoctave_command.c +++ b/pdoctave_command.c @@ -84,7 +84,8 @@ static void *newPDOctaveCommand (t_symbol *s, int argc, t_atom *argv) post("getpdoctaveinstances returned %d", getPDOctaveInstances()); if (getPDOctaveInstances()<1) { - post("Octave not running, insert a 'pdoctave' object!!"); + error("Octave not running, insert a 'pdoctave' object!!"); + return 0; } pdoctcmd_obj->pos = 0; if (argc>0) diff --git a/pdoctave_get.c b/pdoctave_get.c index 1c7df7b..d0e2394 100644 --- a/pdoctave_get.c +++ b/pdoctave_get.c @@ -28,18 +28,21 @@ static void *newPDOctaveGet (t_symbol *s, int argc, t_atom *argv) post("getpdoctaveinstances returned %d", getPDOctaveInstances()); if (getPDOctaveInstances()<1) { - post("Octave not running, insert a 'pdoctave' object!!"); + error("Octave not running, insert a 'pdoctave' object!!"); + return 0; } if (argc>0) name = atom_getsymbol(argv); else name = gensym ("pdm1"); - pdoctget_obj->sdf = newSharedDataFrame (); + if ((pdoctget_obj->sdf = newSharedDataFrame ())==0) { + error("pdoctave_get: failed to get shared memory"); + return 0; + } pdoctget_obj->data = 0; pdoctget_obj->oct_name = name->s_name; pdoctget_obj->outlet = outlet_new (&pdoctget_obj->x_obj, 0); - return ((void *) pdoctget_obj); } diff --git a/pdoctave_send.c b/pdoctave_send.c index b6a38d4..8492120 100644 --- a/pdoctave_send.c +++ b/pdoctave_send.c @@ -24,14 +24,18 @@ static void *newPDOctaveSend (t_symbol *s, int argc, t_atom *argv) t_symbol *name; if (getPDOctaveInstances()<1) { - post("Octave not running, insert a 'pdoctave' object!!"); + error("Octave not running, insert a 'pdoctave' object!!"); + return 0; } if (argc>0) name = atom_getsymbol(argv); else name = gensym ("pdm1"); - pdoctsnd_obj->sdf = newSharedDataFrame (); + if ((pdoctsnd_obj->sdf = newSharedDataFrame ())==0) { + error("pdoctave_send: failed to get shared memory"); + return 0; + } pdoctsnd_obj->data = 0; pdoctsnd_obj->oct_name = name->s_name; |