Tl other leaks

Dear Martin,

While I had fired the memory checker to identify the previous leak, I took the time to look for additional smaller leaks. Those are not as dramatic, but I think they can definitely help when loading new docs repeatedly.

Best regards,

Timothée