Skip to content

Commit 05442e3

Browse files
author
Luke Brooks
committed
Updates the Python wrapper per Thomas Krijnens' suggestion regarding
RAII.
1 parent a421f48 commit 05442e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ifcwrap/IfcParseWrapper.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,10 @@ private:
403403
return f;
404404
}
405405
IfcParse::IfcFile* read(const std::string& data) {
406+
char* copiedData = new char[data.length()];
407+
memcpy(copiedData, data.c_str(), data.length());
406408
IfcParse::IfcFile* f = new IfcParse::IfcFile();
407-
std::string copiedData;
408-
copiedData = data;
409-
f->Init((void *)copiedData.c_str(), data.length());
409+
f->Init((void *)copiedData, data.length());
410410
return f;
411411
}
412412
const char* schema_identifier() {

0 commit comments

Comments
 (0)