Skip to content

Commit dfef400

Browse files
committed
impl
1 parent bfc0260 commit dfef400

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Storages/MergeTree/MergedBlockOutputStream.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ struct MergedBlockOutputStream::Finalizer::Impl
9393
void MergedBlockOutputStream::Finalizer::finish()
9494
{
9595
std::unique_ptr<Impl> to_finish = std::move(impl);
96+
impl.reset();
9697
if (to_finish)
9798
to_finish->finish();
9899
}
@@ -130,7 +131,19 @@ MergedBlockOutputStream::Finalizer::Finalizer(Finalizer &&) noexcept = default;
130131
MergedBlockOutputStream::Finalizer & MergedBlockOutputStream::Finalizer::operator=(Finalizer &&) noexcept = default;
131132
MergedBlockOutputStream::Finalizer::Finalizer(std::unique_ptr<Impl> impl_) : impl(std::move(impl_)) {}
132133

133-
MergedBlockOutputStream::Finalizer::~Finalizer() = default;
134+
MergedBlockOutputStream::Finalizer::~Finalizer()
135+
{
136+
try
137+
{
138+
if (impl)
139+
finish();
140+
}
141+
catch (...)
142+
{
143+
tryLogCurrentException(__PRETTY_FUNCTION__);
144+
}
145+
}
146+
134147

135148
void MergedBlockOutputStream::finalizePart(
136149
const MergeTreeMutableDataPartPtr & new_part,

0 commit comments

Comments
 (0)