Platform cleanup function

Example for #8