bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Nick Liebmann
Subject: Re: Haunting free(): invalid pointer 0x8a11604!
Date: Thu, 10 Feb 2005 15:20:40 +0000
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

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 test-case is definitly the way to go!

Rami Saarinen wrote:

--- Nick Liebmann <address@hidden> 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 of the the classes that are involved: The server creates and runs a "TCPListener" that inherits Thread.
TCPListener waits for the incoming connections and upon connection it will
create a new "TCPSessionThread" to handle the connection. TCPSessionThread
is detached.
TCPSessionThread inherits TCPSession and just overrides the run() method
to collect all the data and passes it to the server.
Nothing too fancy there. Mostly just some own code mixed with the one
found in the examples. The only thing TCPSessionthread creates is a new
string to accumulate the incoming data. String is deleted once.
If there are destructors they are now virtual. One of them was not
originally.
I will have a closer look on your suggestions tomorrow. I think that maybe
I should try to isolate this problem from the rest of the application so I
may build some quick testcase to get the hang of it. Thanks again.
--
Rami Saarinen


                
__________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250





reply via email to

[Prev in Thread] Current Thread [Next in Thread]