File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ void MatAllocator::unmap(UMatData* u) const
60
60
if (u->urefcount == 0 && u->refcount == 0 )
61
61
{
62
62
deallocate (u);
63
- u = NULL ;
64
63
}
65
64
}
66
65
@@ -461,8 +460,11 @@ void Mat::copySize(const Mat& m)
461
460
void Mat::deallocate ()
462
461
{
463
462
if (u)
464
- (u->currAllocator ? u->currAllocator : allocator ? allocator : getDefaultAllocator ())->unmap (u);
465
- u = NULL ;
463
+ {
464
+ UMatData* u_ = u;
465
+ u = NULL ;
466
+ (u_->currAllocator ? u_->currAllocator : allocator ? allocator : getDefaultAllocator ())->unmap (u_);
467
+ }
466
468
}
467
469
468
470
Mat::Mat (const Mat& m, const Range& _rowRange, const Range& _colRange)
Original file line number Diff line number Diff line change @@ -411,8 +411,9 @@ UMat::~UMat()
411
411
412
412
void UMat::deallocate ()
413
413
{
414
- u-> currAllocator -> deallocate (u) ;
414
+ UMatData* u_ = u ;
415
415
u = NULL ;
416
+ u_->currAllocator ->deallocate (u_);
416
417
}
417
418
418
419
You can’t perform that action at this time.
0 commit comments