| 94 | } |
| 95 | |
| 96 | void socketowner::remove_owner_from_socket(SIPpSocket *socket) |
| 97 | { |
| 98 | socket_owner_map_map::iterator map_it = socket_to_owners.find(socket); |
| 99 | /* We must have a map for this socket. */ |
| 100 | assert(map_it != socket_to_owners.end()); |
| 101 | |
| 102 | owner_map *socket_owner_map = (owner_map *) map_it->second; |
| 103 | owner_map::iterator owner_it = socket_owner_map->find(this->ownerid); |
| 104 | /* And our owner must exist in the map. */ |
| 105 | assert(owner_it != socket_owner_map->end()); |
| 106 | socket_owner_map->erase(owner_it); |
| 107 | |
| 108 | /* If we have no more calls, we can delete this entry. */ |
| 109 | if (socket_owner_map->begin() == socket_owner_map->end()) { |
| 110 | delete socket_owner_map; |
| 111 | socket_to_owners.erase(map_it); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /* The caller must delete this list. */ |
| 116 | owner_list *get_owners_for_socket(SIPpSocket *socket) |