Re: Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread Nick Liebmann
I would also suggest declaring empty virtual destructors for any inherited classes for which you have no specific need for a destructor. I dont really know why this should be necessary, but for some reason (at least in the past) I have found this necessary, and now do it as a habit. An isolated

Re: Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread Rami Saarinen
--- Nick Liebmann <[EMAIL PROTECTED]> wrote: > > Following on from this, I'd be inclined to check that all of your > destructors are declared as virtual, and you are not deleting objects > multiple times. > > At first I want to thank you all for the replies. To give a high level rundown o

Re: Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread Nick Liebmann
I am not sure the virtuality of a destructor is inherited but definitly with the gnu compiler I have had issues where not declaring a virtual destructor causes a whole host of problems. From what I remember when playing with this stuff on g++ 2.95 the only time calling 'delete this' caused me g

Re: Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread David Sugar
Thread definately is declared with a virtual destructor, and so is Socket. TCPStream, inherited from Socket, also redeclares a virtual destructor, and TCPSession has no declared destructor at all, although it inherits both TCPStream and Thread. I am not sure what his "TCPSessionThread" has, a

Re: Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread Nick Liebmann
Following on from this, I'd be inclined to check that all of your destructors are declared as virtual, and you are not deleting objects multiple times. Nick David Sugar wrote: Hmm...perhaps it is a dynamic casting issue. The thread close method itself is only really aware of a "Thread" object

Re: Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread David Sugar
In fact, I will go a step further...Thread() is built with a virtual destructor...it appears to me that virtual destructors are not working correcting on your compiler. This would explain the memory offset of the delete free() operation in Thread::close, which I am guessing is likely the offse

Re: Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread David Sugar
Hmm...perhaps it is a dynamic casting issue. The thread close method itself is only really aware of a "Thread" object as the base class itself, at that point in time. If it is unable to handle the delete of the derived virtual object by recasting the pointer references, then perhaps the order

Haunting free(): invalid pointer 0x8a11604!

2005-02-10 Thread Rami Saarinen
Hello again, Ia currently doing some restructuring on the program that I had probelms with few moths ago. I just poke my editor into some very nasty stuff and I'd like to ask if any of you have any idea why I do get a buch of Invalid pointer error messages. The program is heavily threaded "Mess