-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I'm struggling to find that some problems on memory error, though I have solved it , but I can not understand why.Can you help me?

why I add m_head->prev = NULL;It has no memory problem but it can not run.
Another one...
void DouList::operator=(const DouList &src) {
this->clear();
if (src.m_head != NULL) {
DouListNode* m, *p, *r;
m = src.m_head;
while (m != NULL) {
p = new DouListNode(m->elem, NULL, NULL);
if (m == src.m_head) m_head = p;
if (m != src.m_head) {
r->next = p;
p->prev = r;
}
r = p;
p = p->next;
}
m_tail = r;
p = r = m = NULL;
}
}
I don't understand why this has no memory problem but can not run.(memory limit exceed 32MB for the two problems above.I'm sure only these two, because I passed after I fixed the the two.
Metadata
Metadata
Assignees
Labels
No labels