From 76f757f2bdca78c3c51e933cb17e1d74c9b37942 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Thu, 21 Jan 2021 10:43:39 +0800 Subject: [PATCH] bugfixed: add_to_flush_writer_queue MUST before deal function --- src/sf_binlog_writer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sf_binlog_writer.c b/src/sf_binlog_writer.c index b9c0324..4f3c70a 100644 --- a/src/sf_binlog_writer.c +++ b/src/sf_binlog_writer.c @@ -451,9 +451,10 @@ static int deal_binlog_records(SFBinlogWriterThread *thread, thread->mblock, current); } else { current->writer->total_count++; - if ((result=deal_record_by_version(current)) == 0) { - add_to_flush_writer_queue(thread, current->writer); - } else { + add_to_flush_writer_queue(thread, current->writer); + + /* NOTE: current maybe be released in the deal function */ + if ((result=deal_record_by_version(current)) != 0) { return result; } }