Skip to content

Rework SPDocument memory management

PBS requested to merge pbs3141/inkscape:document-ungc into master

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 SPDocuments that no longer leak on exit may consequently need a variant of !4878 (merged) to avoid crashing on exit. This is now fixed in a third commit, and commit messages are now written.

Edited by PBS

Merge request reports