mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 06:21:16 +01:00
[vector] Destruct items in clear() when vector is in error state
The previous fix (d134f888) zeroed `length` but skipped element
destructors. Call shrink_vector(0) instead, which properly destructs
items before clearing length.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7433361337
commit
41de3c3272
1 file changed
+1
-1
+1
-1
@@ -578,7 +578,7 @@ struct hb_vector_t
|
||||
void clear ()
|
||||
{
|
||||
if (!resize (0))
|
||||
length = 0; /* If resize fails (e.g. vector in error state), still clear length. */
|
||||
shrink_vector (0); /* If resize fails (e.g. vector in error state), still destruct items and clear length. */
|
||||
}
|
||||
|
||||
template <typename allocator_t>
|
||||
|
||||
Reference in new issue
Block a user