提交 d1f60d31 编写于 作者: M MikeBeaton

FlexArray: Fix behaviour at zero-length after discard

上级 fea184ff
......@@ -55,7 +55,6 @@ InternalFlexArrayAddItem (
return NULL;
}
} else {
ASSERT (FlexArray->Count > 0);
ASSERT (FlexArray->AllocatedCount > 0);
ASSERT (FlexArray->Count <= FlexArray->AllocatedCount);
++(FlexArray->Count);
......@@ -194,6 +193,10 @@ OcFlexArrayFreeContainer (
} else {
*Items = (*FlexArray)->Items;
*Count = (*FlexArray)->Count;
if (*Count == 0 && *Items != NULL) {
FreePool (*Items);
*Items = NULL;
}
FreePool (*FlexArray);
*FlexArray = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册