Added logging of non-destroyed resources.
Fixed useless Clang warning.
Removed unused code.