Commit 97ac486b authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: registerCopy may fail for copy construct of regIOobject

- checkIn() was incorrectly conditional on the register state of the
  source object.

Partial patch from .org commit 6dc48b62d948
parent 51bac480
......@@ -96,9 +96,12 @@ Foam::regIOobject::regIOobject(const regIOobject& rio, bool registerCopy)
eventNo_(db().getEvent()),
isPtr_(nullptr)
{
if (registerCopy && rio.registered_)
if (registerCopy)
{
const_cast<regIOobject&>(rio).checkOut();
if (rio.registered_)
{
const_cast<regIOobject&>(rio).checkOut();
}
checkIn();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment