*** glibc detected *** double free or corruption - ERROR
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Telling the program exactly how to deep copy objects, if you don't do this then it is only the pointers that get copied and this leads to big problems. (Also remember to make sure that your destructor properly deletes all pointers.
Hope that helps someone.
Last edited by bandwidthjunkie; 03-19-2007 at 09:31 AM.
hmm, maybe you didn't type your program in right, because that shouldn't compile, you're trying to push a MyClass pointer (MyClass*) into a vector of MyClass objects.
You are right I forgot the * in the code above (I have edited it now), it was just an example and what I had written wouldn't have compiled. My situation was that the code compiled, but I got this "double free or corruption error" - I noticed that there were a few long meandering and not very useful threads on various sites about this, but none of them seemed to give an answer to the problem so I thought I would post one here so it might be easy to find from a google search.