mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:37:35 +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;
|
||||
};
|
||||
|
||||
struct OutlineItem final : public RefCounted<OutlineItem> {
|
||||
RefPtr<OutlineItem> parent;
|
||||
struct OutlineItem final : public RefCounted<OutlineItem>
|
||||
, public Weakable<OutlineItem> {
|
||||
WeakPtr<OutlineItem> parent;
|
||||
Vector<NonnullRefPtr<OutlineItem>> children;
|
||||
DeprecatedString title; // Already converted to UTF-8.
|
||||
i32 count { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue