Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!texbell!nuchat!moray!urchin!f506.n106.z1.fidonet.org!Roy.Browning From: Roy.Browning@f506.n106.z1.fidonet.org (Roy Browning) Newsgroups: comp.lang.c++ Subject: lint++ -> really "AutoCodeReview" -- Ideas requested. Message-ID: <5457.25845C8E@urchin.fidonet.org> Date: 11 Dec 89 06:59:53 GMT Sender: ufgate@urchin.fidonet.org (newsout1.26) Organization: FidoNet node 1:106/506 - Fulcrum's Edge, Spring TX Lines: 25 > ComIdent::~ComIdent() > { > if ( string ) > delete[strlen(string)+1] string; > } > The fix --- delete the copy constructor and replace with an assignment > one. Randolph: I have sucessfully used both a copy constructor and an overloading assignment operator in a test class. However from my limited reading on C++ I believe your problem is your destructor. From reading Lippman pages 240 & 241 you are deleting an array of pointers stored in "string" where "[x]" is the number to "free()". From the source code I've seen all "delete" does is to call "free()" and pass it a "char *". Telling "delete" there are "[X]" pointers stored at location "string" should cause some VERY unusual problems if I'm correct. I could use a lint myself, Roy Browning