Merge pull request #3055 from akarsakov:copyto_UMat_fix

This commit is contained in:
Vadim Pisarevsky
2014-08-08 14:20:02 +00:00
2 changed files with 22 additions and 3 deletions

View File

@@ -593,15 +593,16 @@ void* UMat::handle(int accessFlags) const
if( !u )
return 0;
if ((accessFlags & ACCESS_WRITE) != 0)
u->markHostCopyObsolete(true);
// check flags: if CPU copy is newer, copy it back to GPU.
if( u->deviceCopyObsolete() )
{
CV_Assert(u->refcount == 0);
u->currAllocator->unmap(u);
}
if ((accessFlags & ACCESS_WRITE) != 0)
u->markHostCopyObsolete(true);
return u->handle;
}