See above how to reproduce.
Run with the patch applied to see that the filename is gone from the valgrind log (except for a texture leak which occurs elsewhere).
Notice that there was a delete upon `ldr_was_interrupted` but not in the general case!?
Check the revision history as to whodunnit.
Consider the alternative to a shared_ptr, which would be implementing an interface, similar to IGUISetting and CGUISetting<T>.
But this would still mean its complicated to decide when to delete, whereas with the shared_ptr we have less possibility to do it wrongly.