@Override
        public boolean handleMessage(Message message) {
            if (message.what == RECYCLE_RESOURCE) {
                Resource resource = (Resource) message.obj;
                resource.recycle();
                return true;
            }
            return false;
        }
A class that can safely recycle recursive resources.
core/src/main/java/com/bumptech/glide/load/engine/ResourceRecycler.java