This happened to me a couple of times with last pregnancy, I was so shocked, I found if I ever needed to sneeze I had to prepare, clench legs brace etc
It went again as soon as dd born, I thought it was an after birth thing, no one tells you it happens in pregnancy!!!