It has nothing to do with the linked list! As I said, after you remove the old panel and create the new one, the new one gets memory assigned, and this seems mostly to be the panel you removed earlier. If you have "bad" luck, it will sometimes crash, because the second panel pointer is then doesn't equal the first pointer, but so far you seemed to be "lucky".