Skip to content
Snippets Groups Projects
Commit a9b7549c authored by Martin Heistermann's avatar Martin Heistermann
Browse files

experiment: try to avoid race condition

parent f4f947b9
No related branches found
No related tags found
No related merge requests found
...@@ -158,10 +158,14 @@ int FileOVMBPlugin::loadObject(QString _filename) ...@@ -158,10 +158,14 @@ int FileOVMBPlugin::loadObject(QString _filename)
BaseObjectData* obj = nullptr; BaseObjectData* obj = nullptr;
if (*topo_type == TopoType::Tetrahedral) { if (*topo_type == TopoType::Tetrahedral) {
TetrahedralMesh m;
result = reader->read_file(m);
emit addEmptyObject(DATA_TETRAHEDRAL_MESH, id); emit addEmptyObject(DATA_TETRAHEDRAL_MESH, id);
auto *mo = PluginFunctions::tetrahedralMeshObject(id); auto *mo = PluginFunctions::tetrahedralMeshObject(id);
result = reader->read_file(*mo->mesh());
obj = mo; obj = mo;
if (result == ReadResult::Ok) {
*mo->mesh() = std::move(m);
}
} else if (*topo_type == TopoType::Hexahedral) { } else if (*topo_type == TopoType::Hexahedral) {
emit addEmptyObject(DATA_HEXAHEDRAL_MESH, id); emit addEmptyObject(DATA_HEXAHEDRAL_MESH, id);
auto *mo = PluginFunctions::hexahedralMeshObject(id); auto *mo = PluginFunctions::hexahedralMeshObject(id);
...@@ -177,6 +181,8 @@ int FileOVMBPlugin::loadObject(QString _filename) ...@@ -177,6 +181,8 @@ int FileOVMBPlugin::loadObject(QString _filename)
return -1; return -1;
} }
if (result != ReadResult::Ok) { if (result != ReadResult::Ok) {
emit log(LOGERR, QString("Failed to load OVMB file:") + to_string(result));
return -1;
} }
obj->setFromFileName(_filename); obj->setFromFileName(_filename);
obj->setName(obj->filename()); obj->setName(obj->filename());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment