The World Federation One Stop Fiqh

Ruling 1572

If a fasting person who has a wet dream knows that some semen has remained in his penis, and he knows that if he does not urinate before performing ritual bathing (ghusl) semen will be discharged after ghusl, then the recommended precaution is that he should urinate before performing ghusl.