Ray Tayek on Wed, 18 Jan 2006 01:20:58 -0600 (CST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[ALACPP] memory leak


hi, trying to code up some stuff for a class that i am teaching. using cxxtest. seems that i am somehow allocating (new) 24 bytes in the method below. direction is just an enum(north=0,south,east,west,directions). none of my objects are 24 bytes, so it looks like it is something else, but i can not see it. is there something that i need to delete in the method below?

thanks

MapSite *Room::setSide(MapSite::Direction direction,MapSite *mapSite) {
        map<MapSite::Direction,MapSite *>::iterator i=sides_.find(direction);
        MapSite *rc=NULL;
        if(i!=sides_.end()) {
                rc=i->second;
                sides_.erase(i);
        }
sides_.insert(map<MapSite::Direction,MapSite *>::value_type(direction,mapSite));
        return rc;
}

---
vice-chair http://ocjug.org/

_______________________________________________
alacpp mailing list
alacpp@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/alacpp