Skip to content

Commit

Permalink
Properly reset builder state between batches (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot authored Jul 22, 2023
1 parent 1a4c245 commit 800df92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/geoarrow/builder.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ static ArrowErrorCode GeoArrowBuilderInitArrayAndCachePointers(
}

private->buffers[i] = ArrowArrayBuffer(res.array, res.i);
builder->view.buffers[i].data.as_uint8 = NULL;
builder->view.buffers[i].size_bytes = 0;
builder->view.buffers[i].capacity_bytes = 0;
}

// Reset the coordinate counts and values
builder->view.coords.size_coords = 0;
builder->view.coords.capacity_coords = 0;
for (int i = 0; i < 4; i++) {
builder->view.coords.values[i] = NULL;
}

// Set the null_count to zero
Expand Down

0 comments on commit 800df92

Please sign in to comment.