This prevents segfaults on the edge case of the ticket. This does not solve the ticket, it just prevents one of the two causes for a segfault in said situation. There was a 50% chance of either of the two happening (roughly estimated), so now it’s less likely that a segfault happens.
This seems to be a “use after free” scenario which your flag possibly fixes by accident only. When the object is deleted you can technically still read from its old memory address and it has a very high chance of evaluating to boolean true, however sometimes it won’t.
I'm not sure why use-after-free could be happening here, however it appears that Refresher::d->flushPendingDatagramsTimer still fires after the MasterManager is deleted. You could see if that’s the case and see what can be done about that.
I’ll look into it on 5 days. This week I have final exams, and these count ~64% of the final mark, so I’m gonna be kinda occupied.