aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/loader/itemreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/corelib/loader/itemreader.cpp')
-rw-r--r--src/lib/corelib/loader/itemreader.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/corelib/loader/itemreader.cpp b/src/lib/corelib/loader/itemreader.cpp
index e0ad9897d..0638d1af5 100644
--- a/src/lib/corelib/loader/itemreader.cpp
+++ b/src/lib/corelib/loader/itemreader.cpp
@@ -214,6 +214,14 @@ void ItemReader::handleAllPropertyOptionsItems(Item *item)
Item *ItemReader::setupItemFromFile(const QString &filePath, const CodeLocation &referencingLocation)
{
Item *item = readFile(filePath, referencingLocation);
+
+ // This is technically not needed, because files are only set up once and then served
+ // from a cache. But it simplifies the checks in item.cpp if we require the locking invariant
+ // to always hold.
+ std::unique_ptr<ModuleItemLocker> locker;
+ if (item->type() == ItemType::Module)
+ locker = std::make_unique<ModuleItemLocker>(*item);
+
handleAllPropertyOptionsItems(item);
return item;
}