This plugs all the memory leaks that I could get a full traceback for in bitcoin-qt.
In most cases this means properly using the QObject parent hierarchy, in other cases (no qt object, or where parenting would have ancillary effects) I’ve used std::unique_ptr. I’ve introduced no new manual ‘deletes’ or ‘frees’.
Before:
0SUMMARY: AddressSanitizer: 2660170 byte(s) leaked in 39504 allocation(s).
After:
0SUMMARY: AddressSanitizer: 25089 byte(s) leaked in 696 allocation(s).
The leaks that asan finds after this are likely Qt global objects, and some fontconfig related things. I was not able to track them down.