ref: add high level flush to flush all resources
#1989
Merged
flush to flush all resources
#1989