Fix resource leak in deferred render.