Assert stream pool if duplicate entry is found
This commit is contained in:
parent
944f43c0bc
commit
9fee695ed0
@ -248,6 +248,12 @@ static void StreamPool_Remove(wStreamPool* pool, wStream* s)
|
|||||||
{
|
{
|
||||||
StreamPool_EnsureCapacity(pool, 1, FALSE);
|
StreamPool_EnsureCapacity(pool, 1, FALSE);
|
||||||
Stream_EnsureValidity(s);
|
Stream_EnsureValidity(s);
|
||||||
|
for (size_t x = 0; x < pool->aSize; x++)
|
||||||
|
{
|
||||||
|
wStream* cs = pool->aArray[x];
|
||||||
|
|
||||||
|
WINPR_ASSERT(cs != s);
|
||||||
|
}
|
||||||
pool->aArray[(pool->aSize)++] = s;
|
pool->aArray[(pool->aSize)++] = s;
|
||||||
StreamPool_RemoveUsed(pool, s);
|
StreamPool_RemoveUsed(pool, s);
|
||||||
}
|
}
|
||||||
@ -337,14 +343,14 @@ void StreamPool_Clear(wStreamPool* pool)
|
|||||||
|
|
||||||
while (pool->aSize > 0)
|
while (pool->aSize > 0)
|
||||||
{
|
{
|
||||||
(pool->aSize)--;
|
wStream* s = pool->aArray[--pool->aSize];
|
||||||
Stream_Free(pool->aArray[pool->aSize], TRUE);
|
Stream_Free(s, s->isAllocatedStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (pool->uSize > 0)
|
while (pool->uSize > 0)
|
||||||
{
|
{
|
||||||
(pool->uSize)--;
|
wStream* s = pool->uArray[--pool->uSize];
|
||||||
Stream_Free(pool->uArray[pool->uSize], TRUE);
|
Stream_Free(s, s->isAllocatedStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamPool_Unlock(pool);
|
StreamPool_Unlock(pool);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user