A landlord can change the locks while the tenant is living in the unit as long as they give the tenant a key for the new lock. Once a tenant has been evicted from the unit, the landlord can change the locks, even if the tenant has left property in the unit. The landlord does not have to give the former tenant replacement keys in this case.
Source: www.sjto.gov.on.ca