core: re-throw allocation exception if there is no fallback

pull/12815/head
Alexander Alekhin 6 years ago
parent 28cb714a09
commit 8c4f886f5f
  1. 7
      modules/core/src/matrix.cpp

@ -355,14 +355,15 @@ void Mat::create(int d, const int* _sizes, int _type)
#endif
if(!a)
a = a0;
CV_TRY
try
{
u = a->allocate(dims, size, _type, 0, step.p, 0, USAGE_DEFAULT);
CV_Assert(u != 0);
}
CV_CATCH_ALL
catch (...)
{
if(a != a0)
if (a == a0)
throw;
u = a0->allocate(dims, size, _type, 0, step.p, 0, USAGE_DEFAULT);
CV_Assert(u != 0);
}

Loading…
Cancel
Save