1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

fixed a bug (unexpected aborts of CvMat#to_CvMat)

This commit is contained in:
ser1zw 2011-05-15 02:08:02 +09:00
parent a1331c9fdc
commit 7b378e7608
2 changed files with 11 additions and 4 deletions

View file

@ -923,6 +923,10 @@ rb_square_q(VALUE self)
VALUE
rb_to_CvMat(VALUE self)
{
// CvMat#to_CvMat aborts when self's class is CvMat. (I don't know why...)
if (CLASS_OF(self) == rb_klass)
return self;
return DEPEND_OBJECT(rb_klass, cvGetMat(CVARR(self), RB_CVALLOC(CvMat)), self);
}