Sometimes there is need to do cleanup with valid graphic contexts before closing these contexts. The added operation runs a graphics operation on each context before closing them.