something happening wrong while i map::insert:
in header i have
Code: Select all
std::map<MyGUI::StaticImagePtr, MWWorld::Ptr*> mItems;
(which i typedef std::map<MyGUI::StaticImagePtr, MWWorld::Ptr*> mapItems;)
In
Code: Select all
template<class T>
drawItemWidget(std::list<ESMS::LiveCellRef<T, MWWorld::RefData> > itemlist){
i do
Code: Select all
for(typename std::list<ESMS::LiveCellRef<T, MWWorld::RefData> >::iterator it = itemlist.begin(); it != itemlist.end(); it++){
MWWorld::Ptr *ptr=new Ptr(&*it,0);
...creating of widget..., than
Code: Select all
mItems.insert(std::make_pair(widget,ptr);
and
in the end of function after loop i just look at elements in map :
Code: Select all
for(mapItems::iterator it=mItems.begin();it!=mItems.end();it++){
printf("z1 %s:%i\n",MWWorld::Class::get (*(&*it)->second).getInventoryIcon (*(&*it)->second).c_str(), (&*it)->second->getRefData().getCount());
}
which crushes on second iteration if i picked up more than 1 item:\
mItems.size() rise properly, mItems[someproperwidget] works too, but the second element seems like hell's mess