Yi
Posts:
6
Registered:
12/28/12


Re: mexCallMATLAB crashes in loops?
Posted:
Jan 1, 2013 12:16 PM


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kbu49s$3g8$1@newscl01ah.mathworks.com>... > "Yi " <dora.zhuyi@gmail.com> wrote in message <kbt4p3$n00$1@newscl01ah.mathworks.com>... > > > > > //Clean up > > mxDestroyArray(incall[0]); > > mxDestroyArray(mout[0]); > > mxDestroyArray(tmp); > > I haven't run your code, just take a quick look, but it seems wrong to destroy TMP separately, since it belongs to INCALL[0] and already destroyed when mxDestroyArray(incall[0]) is invoked. > > Bruno
Thanks for your reply, Bruno. In fact, I have several trys with and without these mxDestroyArray lines and it turns out all the same. Sometimes I can see the returned variable in matlab but with no dimension information. And When I try to access it, the MATLAB crashes.

