Differences From Artifact [bb466005e7]:
- File
src/serverbrowser.mm
— part of check-in
[489124a92f]
at
2025-03-16 10:11:39
on branch trunk
— Use one autorelease pool per frame
This way, nowhere else autorelease pools need to be managed. (user: js, size: 7373) [annotate] [blame] [check-ins using]
To Artifact [7409dbfc1c]:
- File src/serverbrowser.mm — part of check-in [fd4460c7b6] at 2025-03-20 11:03:23 on branch trunk — Use enumerateObjectsUsingBlock: where appropriate (user: js, size: 7410) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
270 271 272 273 274 275 276 | refreshservers() { checkresolver(); checkpings(); if (lastmillis - lastinfo >= 5000) pingservers(); [servers sort]; | < | > | | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | refreshservers() { checkresolver(); checkpings(); if (lastmillis - lastinfo >= 5000) pingservers(); [servers sort]; __block int maxmenu = 16; [servers enumerateObjectsUsingBlock:^( ServerInfo *si, size_t i, bool *stop) { if (si.address.host != ENET_HOST_ANY && si.ping != 9999) { if (si.protocol != PROTOCOL_VERSION) si.full = [[OFString alloc] initWithFormat: @"%@ [different cube protocol]", si.name]; else |
︙ | ︙ | |||
302 303 304 305 306 307 308 | if (si.full.length > 50) si.full = [si.full substringToIndex:50]; menumanual(1, i, si.full); if (!--maxmenu) return; | < < | | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | if (si.full.length > 50) si.full = [si.full substringToIndex:50]; menumanual(1, i, si.full); if (!--maxmenu) return; }]; } void servermenu() { if (pingsock == ENET_SOCKET_NULL) { pingsock = enet_socket_create(ENET_SOCKET_TYPE_DATAGRAM, NULL); |
︙ | ︙ |