[misc] fix a couple of memory issues

pull/1265/head
Tim Stack 1 month ago
parent e1a1e7099b
commit 8c7d7c3e82

@ -371,6 +371,10 @@ line_buffer::line_buffer()
line_buffer::~line_buffer() line_buffer::~line_buffer()
{ {
if (this->lb_loader_future.valid()) {
this->lb_loader_future.wait();
}
auto empty_fd = auto_fd(); auto empty_fd = auto_fd();
// Make sure any shared refs take ownership of the data. // Make sure any shared refs take ownership of the data.
@ -773,8 +777,7 @@ line_buffer::fill_range(file_off_t start, ssize_t max_length)
if (this->lb_loader_future.wait_for(std::chrono::seconds(0)) if (this->lb_loader_future.wait_for(std::chrono::seconds(0))
!= std::future_status::ready) != std::future_status::ready)
{ {
wait_start wait_start = std::make_optional(std::chrono::system_clock::now());
= std::make_optional(std::chrono::system_clock::now());
} }
retval = this->lb_loader_future.get(); retval = this->lb_loader_future.get();
if (false && wait_start) { if (false && wait_start) {

@ -86,11 +86,12 @@ public:
shared_buffer_ref& sbr, shared_buffer_ref& sbr,
bool full_message) override bool full_message) override
{ {
this->plf_cached_line.resize(23); this->plf_cached_line.resize(32);
sql_strftime(this->plf_cached_line.data(), auto tlen = sql_strftime(this->plf_cached_line.data(),
this->plf_cached_line.size(), this->plf_cached_line.size(),
ll.get_timeval(), ll.get_timeval(),
'T'); 'T');
this->plf_cached_line.resize(tlen);
{ {
char zone_str[16]; char zone_str[16];
exttm tmptm; exttm tmptm;

Loading…
Cancel
Save