Fix a resource leak in Loaders.cpp