Yes, if you delete the friend code the friend safari gets deleted as well. Also sometimes there's a lagg deleting the fc.
One more thing while in the friend safari and you've deleted that friend code, you won't get kicked out of it, you can go about catching/training. But afterwards when you're done with it and walk out that's when it disappears. Hope I helped c: