Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 1, 2009, 11:09:05 AM (15 years ago)
Author:
scheusso
Message:

fixing a bug that made a segfault/memory corruption/corrupted double linked list in some cases of client disconnect

Location:
code/branches/core5/src/libraries/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/network/Connection.h

    r5738 r5847  
    6464   
    6565    int service(ENetEvent* event);
    66     void disconnectPeer(ENetPeer *peer);
     66    virtual void disconnectPeer(ENetPeer *peer);
    6767   
    6868    void processQueue();
  • code/branches/core5/src/libraries/network/Server.cc

    r5822 r5847  
    330330    // inform all the listeners
    331331    ClientConnectionListener::broadcastClientDisconnected(client->getID());
    332 
    333     delete client; //remove client from list
    334332  }
    335333
  • code/branches/core5/src/libraries/network/ServerConnection.cc

    r5749 r5847  
    103103  {
    104104    Connection::disconnectPeer( client->getPeer() );
     105    std::cout << "disconnecting peer and removing client" << endl;
    105106    delete client;
    106107  }
     
    119120    ClientInformation *client = ClientInformation::findClient(clientID);
    120121    if(client)
    121       disconnectClient(client);
     122      ServerConnection::disconnectClient(client);
    122123  }
    123124
     
    126127    ClientInformation *temp = ClientInformation::getBegin();
    127128    while(temp!=0){
    128       disconnectClient( temp );
     129      ServerConnection::disconnectClient( temp );
    129130      temp = temp->next();
    130131    }
  • code/branches/core5/src/libraries/network/ServerConnection.h

    r5738 r5847  
    5959    static bool addPacketAll(ENetPacket *packet);
    6060    virtual void disconnectClient(ClientInformation *client);
    61     void disconnectPeer( ENetEvent* event );
     61    virtual void disconnectPeer( ENetEvent* event );
    6262    void disconnectClient(int clientID);
    6363  protected:
Note: See TracChangeset for help on using the changeset viewer.