Commit 82eedb5b authored by mattijs's avatar mattijs
Browse files

BUG: Time : set up file monitoring only if runTimeModifiable

parent d98c5f9b
......@@ -245,13 +245,13 @@ Foam::Time::Time
readLibs_(controlDict_, "libs"),
functionObjects_(*this)
{
setControls();
// Time objects not registered so do like objectRegistry::checkIn ourselves.
if (runTimeModifiable_)
{
controlDict_.watchIndex() = addWatch(controlDict_.filePath());
}
setControls();
}
......@@ -307,14 +307,18 @@ Foam::Time::Time
readLibs_(controlDict_, "libs"),
functionObjects_(*this)
{
setControls();
// Time objects not registered so do like objectRegistry::checkIn ourselves.
if (runTimeModifiable_)
{
controlDict_.watchIndex() = addWatch(controlDict_.filePath());
// File might not exist yet.
fileName f(controlDict_.filePath());
if (f != fileName::null)
{
controlDict_.watchIndex() = addWatch(f);
}
}
setControls();
}
......
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