mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
#4452 release gil in ifcopenshell.open() and read()
This commit is contained in:
@@ -582,14 +582,20 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
|
||||
|
||||
%inline %{
|
||||
IfcParse::IfcFile* open(const std::string& fn) {
|
||||
IfcParse::IfcFile* f = new IfcParse::IfcFile(fn);
|
||||
IfcParse::IfcFile* f;
|
||||
Py_BEGIN_ALLOW_THREADS;
|
||||
f = new IfcParse::IfcFile(fn);
|
||||
Py_END_ALLOW_THREADS;
|
||||
return f;
|
||||
}
|
||||
|
||||
IfcParse::IfcFile* read(const std::string& data) {
|
||||
char* copiedData = new char[data.length()];
|
||||
memcpy(copiedData, data.c_str(), data.length());
|
||||
IfcParse::IfcFile* f = new IfcParse::IfcFile((void *)copiedData, data.length());
|
||||
IfcParse::IfcFile* f;
|
||||
Py_BEGIN_ALLOW_THREADS;
|
||||
f = new IfcParse::IfcFile((void *)copiedData, data.length());
|
||||
Py_END_ALLOW_THREADS;
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user