Fixed multiwheel crash (bug from copy constructor).

This commit is contained in:
emb 2015-10-21 20:29:36 -05:00
parent 1c67c485c3
commit ba5b3ffff7
2 changed files with 5 additions and 21 deletions

View File

@ -96,25 +96,8 @@ ScrollingList::ScrollingList(const ScrollingList &copy)
scrollPoints_ = NULL;
tweenPoints_ = NULL;
if(copy.scrollPoints_)
{
scrollPoints_ = new std::vector<ViewInfo *>();
for(unsigned int i = 0; i < copy.scrollPoints_->size(); ++i)
{
ViewInfo *v = new ViewInfo(*copy.scrollPoints_->at(i));
scrollPoints_->push_back(v);
}
}
setPoints(copy.scrollPoints_, copy.tweenPoints_);
if(copy.tweenPoints_)
{
tweenPoints_ = new std::vector<AnimationEvents *>();
for(unsigned int i = 0; i < copy.tweenPoints_->size(); ++i)
{
AnimationEvents *v = new AnimationEvents(*copy.tweenPoints_->at(i));
tweenPoints_->push_back(v);
}
}
}
@ -176,6 +159,7 @@ void ScrollingList::allocateSpritePoints()
{
if(!items_ || items_->size() == 0) return;
if(!scrollPoints_) return;
if(components_.size() == 0) return;
for(unsigned int i = 0; i < scrollPoints_->size(); ++i)
{

View File

@ -447,9 +447,9 @@ bool Page::pushCollection(CollectionInfo *collection)
// grow the menu as needed
if(menus_.size() >= menuDepth_ && activeMenu_)
{
ScrollingList *newList = new ScrollingList(*activeMenu_);
newList->forceIdle();
pushMenu(newList);
activeMenu_ = new ScrollingList(*activeMenu_);
activeMenu_->forceIdle();
pushMenu(activeMenu_);
}