Commit 1344fa28 authored by zhujiashun's avatar zhujiashun

fix_share_tls_block

parent 846f7998
......@@ -366,9 +366,13 @@ inline IOBuf::Block* share_tls_block() {
}
IOBuf::Block* new_block = NULL;
if (b) {
new_block = b->portal_next;
b->dec_ref();
--tls_data.num_blocks;
new_block = b;
while (new_block && new_block->full()) {
IOBuf::Block* const saved_next = new_block->portal_next;
new_block->dec_ref();
--tls_data.num_blocks;
new_block = saved_next;
}
} else if (!tls_data.registered) {
tls_data.registered = true;
// Only register atexit at the first time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment