Resources debug window and fix for resource cleanup