mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:27:45 +00:00
LibPDF: Eliminate reference cycle between OutlineItem parent/children
Since all parents held a reference pointer to their children, and all children held reference pointers to their parents, both objects would never get free'd once the document was no longer being used. Fixes ossfuzz-63833.
This commit is contained in:
parent
681771d210
commit
aad5c58996
1 changed files with 3 additions and 2 deletions
|
@ -36,8 +36,9 @@ struct Destination {
|
||||||
Vector<Optional<float>> parameters;
|
Vector<Optional<float>> parameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct OutlineItem final : public RefCounted<OutlineItem> {
|
struct OutlineItem final : public RefCounted<OutlineItem>
|
||||||
RefPtr<OutlineItem> parent;
|
, public Weakable<OutlineItem> {
|
||||||
|
WeakPtr<OutlineItem> parent;
|
||||||
Vector<NonnullRefPtr<OutlineItem>> children;
|
Vector<NonnullRefPtr<OutlineItem>> children;
|
||||||
DeprecatedString title; // Already converted to UTF-8.
|
DeprecatedString title; // Already converted to UTF-8.
|
||||||
i32 count { 0 };
|
i32 count { 0 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue