mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 10:34:23 +01:00
[object] Only destruct object if it's not trivially-destructible
Such that we're legally free to access the object to destruct its (pointer) fields ourselves afterwards. For things like hb_font_t, hb_face_t, etc.
This commit is contained in:
1 parent
172cc82032
commit
de37b2650d
1 file changed
+2
-1
+2
-1
@@ -273,7 +273,8 @@ static inline bool hb_object_destroy (Type *obj)
|
||||
|
||||
hb_object_fini (obj);
|
||||
|
||||
obj->~Type ();
|
||||
if (!std::is_trivially_destructible<Type>::value)
|
||||
obj->~Type ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user