[Sebastian Nowozin] Fixed memory leak in MatLab interface (dai.cpp)
authorJoris Mooij <joris.mooij@tuebingen.mpg.de>
Mon, 10 Aug 2009 19:59:05 +0000 (21:59 +0200)
committerJoris Mooij <joris.mooij@tuebingen.mpg.de>
Mon, 10 Aug 2009 19:59:05 +0000 (21:59 +0200)
src/matlab/dai.cpp

index 1169e35..5eb9ae9 100644 (file)
@@ -140,6 +140,7 @@ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray*prhs[] )
             qf.push_back( obj->belief( fg.factor(I).vars() ) );
         QF_OUT = Factors2mx( qf );
     }
+    delete obj;
     
     return;
 }