Fixed error spam and a memory leak
This commit is contained in:
parent
c7985c4dd1
commit
f48b904935
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user