Rework SPDocument memory management
Remove the custom deleter and garbage collection from SPDocument
, and eliminate all owning raw pointers in favour of unique_ptr
(shared_ptr
was never needed, but is used in a few existing places in the codebase), fixing copious quantities of leaks.
The MR is split into a minimal GC removal commit, followed by further refactoring of the horror shows encountered.
It's in Draft status because first, I need to write proper descriptions and maybe migrate a few changes between the two commits, and more importantly, various static This is now fixed in a third commit, and commit messages are now written.SPDocument
s that no longer leak on exit may consequently need a variant of !4878 (merged) to avoid crashing on exit.