# HG changeset patch # User samer # Date 1328466054 0 # Node ID 084a1e7377a71bc540fbd2511f9a158c865f0771 # Parent f2a0f5eaaaa51150dfeca6c5de690d4a546a5336 Locking up bug continues to cause trouble around mlWSGet. diff -r f2a0f5eaaaa5 -r 084a1e7377a7 cpp/plml.cpp --- a/cpp/plml.cpp Sun Feb 05 11:29:55 2012 +0000 +++ b/cpp/plml.cpp Sun Feb 05 18:20:54 2012 +0000 @@ -580,10 +580,12 @@ foreign_t mlWSGet(term_t var, term_t val) { try { struct wsvar *x = term_to_wsvar(var); - //printf(" - mlWSGET \r"); fflush(stdout); mxArray *p = engGetVariable(x->engine, x->name); - //printf(" \r"); fflush(stdout); - return PL_unify_blob(val, (void **)&p, sizeof(p), &mx_blob); + if (p) return PL_unify_blob(val, (void **)&p, sizeof(p), &mx_blob); + else { + printf("\n!! mlWSGet: failed to get %s.\n",x->name); + return raise_exception("mlWSGet: failed to get variable."); + } } catch (PlException &e) { return e.plThrow(); } diff -r f2a0f5eaaaa5 -r 084a1e7377a7 prolog/plml.pl --- a/prolog/plml.pl Sun Feb 05 11:29:55 2012 +0000 +++ b/prolog/plml.pl Sun Feb 05 18:20:54 2012 +0000 @@ -619,7 +619,8 @@ % Most other conversions from ws(_) go via mx(_) convert_ws(T,Z,A) :- - mlWSGET(Z,X), convert_mx(T,X,A). + mlWSGET(Z,X), + convert_mx(T,X,A). %% convert_mx( +Type:type, +In:mx_blob, -Out:Type) is det.