netheril96 / StaticJSON

Fast, direct and static typed parsing of JSON with C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shadow_type can't be JsonDocument.

heroboy opened this issue · comments

In ConversionHandler::reset();

void reset() override
    {
        internal.prepare_for_reuse();
        shadow = shadow_type();
    }

If shadow_type is JsonDocument, then internal will be JSONHandler which reference the shadow.m_alloc. And if you call shadow = shadow_type();, it will destroy the m_alloc referenced by internal.

Good catch. Fixed in 26479e5.