Current sheets in two-dimensional potential magnetic fields. III. Formation in complex topology configurations and application to coronal heating.