Fruit flies are mainly attracted to ripened fruit and damaged foliage. They are also drawn to open trash cans, garbage disposal, empty fruit juice cans, and beer bottles. Anything that's rotting and damp is where they find themselves at home. So it'll be wise to even clear these other breeding grounds. Clean out the trash regularly, replace old soil, and keep all surfaces dry and clean. Many times, fruit flies breed in drains. There's no way of knowing how bad the infestation is inside drains.  So it's best to get some drain gel that traps and kills fruit flies.