mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
refs #601 Fixed thread safety of get() by adding getCopy().
This commit is contained in:
@@ -422,7 +422,20 @@ namespace BlackMisc
|
||||
return element;
|
||||
}
|
||||
|
||||
bool CValuePage::isValid(const Element &element, int typeId) const
|
||||
{
|
||||
auto reader = element.m_value.read();
|
||||
return reader->isValid() && reader->userType() == typeId;
|
||||
}
|
||||
|
||||
const CVariant &CValuePage::getValue(const Element &element) const
|
||||
{
|
||||
Q_ASSERT(QThread::currentThread() == thread());
|
||||
|
||||
return element.m_value.read();
|
||||
}
|
||||
|
||||
CVariant CValuePage::getValueCopy(const Element &element) const
|
||||
{
|
||||
return element.m_value.read();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user