Resolves at least one BIG memory bug.  hoorah

I finally figured out that the problem was that constructModelmex was being cleared, therefore destroying the memory allocated with it, before the delete function was being called (at least on some platforms). added mexLock and mexUnlock logic to protect against this.

i've updated drakeMexPointer, and IKoptions, but not RigidBodyConstraints (which reimplemented their own mex pointer classes!!)
done.

On Aug 7, 2014, at 10:44 PM, Hongkai Dai <notifications@github.com> wrote:

> In util/drakeUtil.cpp:
> 
> > @@ -59,26 +59,36 @@ bool mexCallMATLABsafe(int nlhs, mxArray* plhs[], int nrhs, mxArray* prhs[], con
> >  
> >  
> >  
> > -mxArray* createDrakeMexPointer(void* ptr, const char* deleteMethod, const char* name)
> > +mxArray* createDrakeMexPointer(void* ptr, const char* name, int additional_inputs, mxArray* delete_fcn_additional_inputs[])
> rename additional_inputs to num_additional_inputs?
> 
> —
> Reply to this email directly or view it on GitHub.
>