If your employer fails to give you a P45 after being asked to do so, you should contact your tax office as they may encourage your employer to issue a P45.
If your employer cannot be persuaded, a new employer will ask you to complete a P46 form which allows your new employer to deduct tax on an emergency code until the right amount of tax to be deducted is worked out.