From f48b904935d3b25e12acac374d41948ae12b9c99 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 3 May 2021 10:42:03 +0200 Subject: [PATCH] Fixed error spam and a memory leak --- src/Error.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Error.h b/src/Error.h index 9036de6..8133275 100644 --- a/src/Error.h +++ b/src/Error.h @@ -253,6 +253,12 @@ namespace ts { [[nodiscard]] inline bool has_error() const { switch (this->type()) { case command_result_type::bulked: + for(const auto& bulk : *this->bulks()) { + if(bulk.has_error()) { + return true; + } + } + return false; case command_result_type::error: return this->error_code() != error::ok; @@ -320,6 +326,9 @@ namespace ts { auto type = this->type(); if(type == command_result_type::bulked) { auto bulks = this->bulks(); + for(auto& bulk : *bulks) { + bulk.release_data(); + } delete bulks; } else if(type == command_result_type::detailed) { auto details = this->details();