Hello,

Network first contains a singleton of type NetworkLocal. Indeed, 
NetworkLocal as well as NetworkServer are derived from Network.

When asked to start server, above method is invoked. A NetworkServer is 
created. Through it, SDL_Net is initialized, and on success Network's 
singleton becomes the newly created NetworkServer.

At this point, every thing seems OK. Then it falls apart: the previous 
singleton of type NetworkLocal needs to be destroyed. This implies that 
Network's destructor is called. However, this uninitializes SDL_Net, 
while NetworkServer is still expecting to use it.

I've validated such point by having a variable count the number of 
existing instances of objects derived from Network, and only calling 
SDLNet_Quit() when it reaches 0. This pseudo-refcounting does fix the 
problem of the initial connection.

But there is probably be more to it than just this. At this point, 
nothing should work. I suspect that linux is unaffected because the 
network stack state doesn't depend on SDL_Net being correctly initialized.

So... What do we do? Are there any other thing that becomes more 
obviously broken now for anyone ?

Best regards,
Kurosu

_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à