Skip to content

Commit c215c87

Browse files
committed
Assert that we've initialized before resolving hostnames
1 parent e4818a4 commit c215c87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/SDL_net.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,9 @@ static void trim_whitespace(char *str)
616616

617617
NET_Address *NET_ResolveHostname(const char *host)
618618
{
619+
// If this isn't true, we'll spin up resolver threads without locking that will be orphaned in NET_Init()
620+
SDL_assert(SDL_GetAtomicInt(&initialize_count) > 0);
621+
619622
NET_Address *addr = SDL_calloc(1, sizeof (NET_Address));
620623
if (!addr) {
621624
return NULL;

0 commit comments

Comments
 (0)