Function for patching all objects