Changeset 114 for osgVisual


Ignore:
Timestamp:
Jul 31, 2010, 2:19:59 PM (14 years ago)
Author:
Torben Dannhauer
Message:

memory leak in clusterENet fixed

Location:
osgVisual
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/include/cluster/dataIO_clusterENet_implementation.h

    r94 r114  
    8585       
    8686        /**
    87          * \brief This function send a packet to the peer with the specified peer ID (number of the peer in the peer vector). This function works bidirectional from SERVER to CLIENT and vice versa.
     87         * \brief This function send a packet to the peer with the specified peer ID (number of the peer in the peer vector). This function works bidirectional from SERVER to CLIENT and vice versa. This function takes ownership of the packet and will destroy it after (un-)successful transmission.
    8888         *
    8989         * @param packet_ : Data packet to broadcast.
     
    9595
    9696        /**
    97          * \brief This function send a packet to the peer with the specified peerName.
     97         * \brief This function send a packet to the peer with the specified peerName. This function works bidirectional from SERVER to CLIENT and vice versa. This function takes ownership of the packet and will destroy it after (un-)successful transmission.
    9898         *
    9999         * @param channelID_ : ID on which channel the broadcast should be done.
  • osgVisual/src/cluster/dataIO_clusterENet_implementation.cpp

    r107 r114  
    145145        {
    146146                //std::cout << "dataIO_clusterENet_implementation::sendPacket() - ERROR: No connected peer available!" << std::endl;
     147               
     148                // If we can't send the packet, we have to destroy it to free it's memory (In a case of send ENet takes ownership and frees after sending.).
     149                enet_packet_destroy (packet_);
     150
    147151                return;
    148152        }
  • osgVisual/src/core/osgVisual.cpp

    r88 r114  
    8181        core->shutdown();
    8282
    83         // Set Pointer to null to destroy the objects before this function ends - otherwise memory leaks wil be detected.
     83        // Set Pointer to null to destroy the objects before this function ends
    8484        core = NULL;
    8585
Note: See TracChangeset for help on using the changeset viewer.