Skip to content

Commit 8fb60aa

Browse files
author
xiao.dong
committed
fix schema release
1 parent 0f1699c commit 8fb60aa

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/iceberg/manifest_adapter.cc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ Status ManifestAdapter::AppendField(ArrowArray* arrowArray,
9090
}
9191

9292
ManifestEntryAdapter::~ManifestEntryAdapter() {
93-
// arrow::ImportedArrayData::Release() bridge.cc:1478 will release the
94-
// internal array, so we have no need to release it here.
95-
// if (is_initialized_) {
96-
// ArrowArrayRelease(&array_);
97-
// }
93+
if (is_initialized_) {
94+
// arrow::ImportedArrayData::Release() bridge.cc:1478 will release the
95+
// internal array, so we have no need to release it here.
96+
// ArrowArrayRelease(&array_);
97+
ArrowSchemaRelease(&schema_);
98+
}
9899
}
99100

100101
std::shared_ptr<StructType> ManifestEntryAdapter::GetManifestEntryStructType() {
@@ -471,11 +472,12 @@ Status ManifestEntryAdapter::InitSchema(const std::unordered_set<int32_t>& field
471472
}
472473

473474
ManifestFileAdapter::~ManifestFileAdapter() {
474-
// arrow::ImportedArrayData::Release() bridge.cc:1478 will release the
475-
// internal array, so we have no need to release it here.
476-
// if (is_initialized_) {
477-
// ArrowArrayRelease(&array_);
478-
// }
475+
if (is_initialized_) {
476+
// arrow::ImportedArrayData::Release() bridge.cc:1478 will release the
477+
// internal array, so we have no need to release it here.
478+
// ArrowArrayRelease(&array_);
479+
ArrowSchemaRelease(&schema_);
480+
}
479481
}
480482

481483
Status ManifestFileAdapter::AppendPartitions(

0 commit comments

Comments
 (0)