light: fix delete-resource forced dealloc