mirror of
https://pdfium.googlesource.com/pdfium
synced 2026-07-30 10:21:46 +08:00
Embedder tests often install stack-local delegates, but EmbedderTest can invoke delegate callbacks while closing the document in TearDown(). By then, a stack delegate may already have been destroyed. Add SetOwnedDelegate() so the fixture owns the custom delegate through document teardown, then restores the default delegate before releasing it. Migrate all existing call sites, remove the raw SetDelegate() API, and store the active delegate as an UnownedPtr. Bug: 535697671 Change-Id: I8e8da028e9c563e82d40099637c63978122077eb Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/152110 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>