Skip to content

Commit a356778

Browse files
committed
Bug Fixes
1 parent d095790 commit a356778

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/wasm/parsing/IfcTokenChunk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace webifc::parsing
1717
{
1818
_chunkData = nullptr;
1919
if (_fileStream!=nullptr) Load();
20-
20+
else _loaded=true;
2121
}
2222

2323
bool IfcTokenStream::IfcTokenChunk::Clear()

src/wasm/web-ifc-api.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,15 @@ void StreamMeshes(uint32_t modelID, const std::vector<uint32_t> & expressIds, em
181181
}
182182
}
183183

184-
void StreamMeshesVal(uint32_t modelID, emscripten::val expressIdsVal, emscripten::val callback)
184+
void StreamMeshesWithExpressID(uint32_t modelID, emscripten::val expressIdsVal, emscripten::val callback)
185185
{
186186
std::vector<uint32_t> expressIds;
187187

188188
uint32_t size = expressIdsVal["length"].as<uint32_t>();
189189
uint32_t index = 0;
190-
while (index < size)
190+
for (size_t i=0; i < size; i++)
191191
{
192-
emscripten::val expressIdVal = expressIdsVal[std::to_string(index++)];
192+
emscripten::val expressIdVal = expressIdsVal[std::to_string(i)];
193193

194194
uint32_t expressId = expressIdVal.as<uint32_t>();
195195

@@ -1025,7 +1025,7 @@ EMSCRIPTEN_BINDINGS(my_module) {
10251025
emscripten::function("IsModelOpen", &IsModelOpen);
10261026
emscripten::function("GetGeometry", &GetGeometry);
10271027
emscripten::function("GetFlatMesh", &GetFlatMesh);
1028-
emscripten::function("StreamMeshes", &StreamMeshesVal);
1028+
emscripten::function("StreamMeshes", &StreamMeshesWithExpressID);
10291029
emscripten::function("GetCoordinationMatrix", &GetCoordinationMatrix);
10301030
emscripten::function("StreamAllMeshes", &StreamAllMeshes);
10311031
emscripten::function("StreamAllMeshesWithTypes", &StreamAllMeshesWithTypesVal);

tests/functional/WebIfcApi.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ describe('creating ifc', () => {
570570
describe('opening large amounts of data', () => {
571571
test("open a small model but with a heavy memory restriction", () => {
572572
let s: LoaderSettings = {
573-
MEMORY_LIMIT : 209714,
573+
MEMORY_LIMIT : 10485760,
574574
TAPE_SIZE : 104857
575575
};
576576
const exampleIFCData = fs.readFileSync(path.join(__dirname, '../artifacts/S_Office_Integrated Design Archi.ifc.test'));

0 commit comments

Comments
 (0)