mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::json::stack: Move final-flush to stack dtor rather than top value dtor.
This commit is contained in:
parent
ec50b0f76e
commit
ea4912d09a
1 changed files with 9 additions and 7 deletions
16
ircd/json.cc
16
ircd/json.cc
|
@ -447,6 +447,10 @@ noexcept
|
||||||
ircd::json::stack::~stack()
|
ircd::json::stack::~stack()
|
||||||
noexcept
|
noexcept
|
||||||
{
|
{
|
||||||
|
assert(closed());
|
||||||
|
if(buf.consumed())
|
||||||
|
flush(true);
|
||||||
|
|
||||||
assert(clean() || done());
|
assert(clean() || done());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,7 +692,7 @@ ircd::json::stack::object::object(stack &s)
|
||||||
}
|
}
|
||||||
|
|
||||||
ircd::json::stack::object::object(stack &s,
|
ircd::json::stack::object::object(stack &s,
|
||||||
const string_view &name)
|
const string_view &name)
|
||||||
:object{object::top(s), name}
|
:object{object::top(s), name}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -784,13 +788,12 @@ noexcept
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// branch taken if top of stack:: (w/ final flush)
|
// branch taken if top of stack::
|
||||||
assert(s->co == this);
|
assert(s->co == this);
|
||||||
assert(s->ca == nullptr);
|
assert(s->ca == nullptr);
|
||||||
assert(pm == nullptr && pa == nullptr);
|
assert(pm == nullptr && pa == nullptr);
|
||||||
s->co = nullptr;
|
s->co = nullptr;
|
||||||
assert(s->done());
|
assert(s->closed());
|
||||||
s->flush(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -958,13 +961,12 @@ noexcept
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// branch taken if top of stack:: (w/ final flush)
|
// branch taken if top of stack::
|
||||||
assert(s->ca == this);
|
assert(s->ca == this);
|
||||||
assert(s->co == nullptr);
|
assert(s->co == nullptr);
|
||||||
assert(pm == nullptr && pa == nullptr);
|
assert(pm == nullptr && pa == nullptr);
|
||||||
s->ca = nullptr;
|
s->ca = nullptr;
|
||||||
assert(s->done());
|
assert(s->closed());
|
||||||
s->flush(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue