If you think it's for attention, then don't giver this behaviour any attention. My DD who is also 4 also occasionally wets herself, she's also starting school in September. When she does it, I just tell her to go and change her pants (and clothes if necessary) so that we can carry on doing whatever we were doing. I don't show any irritation (though I sometimes feel it), I'm just very matter of fact. Don't worry about her being "the one that wets herself" - you'll make her worry about it, cause her stress, and make it more likely to happen. Also, the teachers are used to dealing with this now that kids are starting school so young (at my DS's school, we are asked to provide spare socks and pants for reception children). It really isn't that unusual, honestly, she won't be the only one who wets herself, loads of them do at least once in the first year.
The ohter thing if you think it's an attention thing, is to give her praise when she remembers to go to the loo even in the middle of a game. Or to remind her, and then praise her loads when she does a wee-wee, so that she gets the message that when she wets herself there's no mileage in it but if she doesn't, she gets loads of positive attention.
As it's a recent thing, could it also be a slight worry about starting school? Or as WWB says, it could be an infection, it might be worth getting it checked out.
HTH