1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-05 23:10:07 +00:00

AK: Add NOTE about VERIFY in Function::clear

This commit is contained in:
Itamar 2021-06-25 12:34:29 +03:00 committed by Andreas Kling
parent 22d7e57955
commit eecbcff6af

View File

@ -189,6 +189,7 @@ private:
void clear(bool may_defer = true)
{
bool called_from_inside_function = m_call_nesting_level > 0;
// NOTE: This VERIFY could fail because a Function is destroyed from within itself.
VERIFY(may_defer || !called_from_inside_function);
if (called_from_inside_function && may_defer) {
m_deferred_clear = true;