Added texture cache flush on shutdown