regIOobject: Avoid segmentation fault when destroying objectRegistry with debug on

This commit is contained in:
Henry Weller
2018-05-24 13:29:11 +01:00
parent 6c560795cb
commit f14637a965

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -147,14 +147,21 @@ Foam::regIOobject::~regIOobject()
{ {
if (objectRegistry::debug) if (objectRegistry::debug)
{ {
Pout<< "Destroying regIOobject called " << name() if (this == &db())
<< " of type " << type() {
Pout<< "Destroying objectRegistry " << name()
<< " in directory " << rootPath()/caseName()/instance()
<< endl;
}
else
{
Pout<< "Destroying regIOobject " << name()
<< " in directory " << path() << " in directory " << path()
<< endl; << endl;
} }
}
// Check out of objectRegistry if not owned by the registry // Check out of objectRegistry if not owned by the registry
if (!ownedByRegistry_) if (!ownedByRegistry_)
{ {
checkOut(); checkOut();