fixed memory leak in CvKNearest::train() and the constructor.
This commit is contained in:
parent
2cf34c7f46
commit
4e099d2e5c
@ -141,6 +141,9 @@ bool CvKNearest::train( const CvMat* _train_data, const CvMat* _responses,
|
||||
ok = true;
|
||||
|
||||
__END__;
|
||||
|
||||
if( responses && responses->data.ptr != _responses->data.ptr )
|
||||
cvReleaseMat(&responses);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user