He said to his wife: “You are free of me when you get your visa”
If a man says to his wife, “You are free” or “You are free of me if you do such and such”, this is a metaphor for divorce. The words of divorce are two types: explicit and implicit.
Explicit forms of divorce are words like “You are divorced (taaliq or mutallaqah).” In this case it counts as a divorce even if the husband did not intend that.
Implicit forms of divorce are words like “You are free” or “You are free of me” or “Go to your family” and so on. In this case it does not count as a divorce unless the husband intended divorce.
Based on that, if the husband intended divorce by saying these words, then his wife became divorced when she got her visa. If he did not intend divorce, then nothing has happened.
And Allah knows best.