Page 1 of 1

[irr 1.2] [Fixed] Listspointers

Posted: Sat Mar 24, 2007 4:13 pm
by Strong99
I have an bug, list1 = list2 doesn't work, the code gives an error in the clear function, the list are the sametype and it doens;t matter if list1 is empty or filled before the =.

Posted: Sat Mar 24, 2007 7:22 pm
by Strong99
i use an own made class

named lod.

irr::core::list<CLod*> list1;

some push backs follow readed from file

than

irr::core::list<CLod*>list2 = list1;

And the error occurs in clear... but why? using clear is ok. But why an error when we use = ? even ::Iterator i = list1.begin() crashes

Posted: Sat Mar 24, 2007 7:57 pm
by Strong99
i found examples from Irrlicht 1.1 and 1.0 over list1 = list2 seemd to work there whats wrong? even those examples stopt working on irr 1.2

Posted: Sat Mar 24, 2007 8:13 pm
by Strong99

Posted: Sat Mar 24, 2007 10:03 pm
by hybrid
That's no bug fix for your problem, because 1.2 introduced the copy constructor for lists which apparently introduced a bug for you. Maybe I should also make list test cases... Right now I don't know if there's an error in list.

Posted: Sat Mar 24, 2007 10:53 pm
by Strong99
k thnx

Posted: Tue Apr 10, 2007 12:42 am
by juantar
I get the same problem with the list's copy constructor. By debugging I found out that my program crashes in these lines:

void clear()
{
SKListNode* node = root;
while(node)
{
SKListNode* next = node->next;
delete node;
node = next;
}

root = 0;
last = 0;
size = 0;
}
root happens to have a junk value (non-initialized). I fixed my copy of irrlist.h as this (http://irrlicht.sourceforge.net/phpBB2/ ... sc&start=0 ) post said and it worked.

Posted: Tue Apr 10, 2007 9:47 am
by hybrid
But that had been fixed some time ago :shock: