delete useless resources.