[linux-audio-dev] A C++ question

Nick Tsocanos nicktsocanos at charter.net
Fri Apr 18 21:48:00 UTC 2003


On Fri, 2003-04-18 at 08:48, Martijn Sipkema wrote:
> [...]
> > You always need a virtual destructor in the class if you do inhertance.
> > Otherwise upon destruction of the derived class, the baseclass destructor
> > will not be called.
> 
> I doubt that is the problem. You should use virtual destructors when
> deleting using a pointer so the correct destructor is called but when
> you know the pointer is of the correct type or you allocate the instance
> on the stack then the correct destructor will be called and I think the
> baseclass destructor(s) will be called also even if they are not
> virtual.
> 
> --ms
> 
> 
> 
Well whatever the problem was, it is not happening anymore..

I really don't know what the problem is and to be honest, I don't think
anyone else on the list could tell me unless they were here to see the
problem happen and analyze it when it happens. 

It may have been something I did in my code. I was building a somewhat
complicated memory management system for LADSPA plugins and the problem
started happening.

Once I fixed the code where it worked properly the problem went away.
I just did not manage to find out what exactly was causing the problem
or why. 

I have no idea but I am pretty sure I did something with unitialized
memory, and than later fixed it without realizing it . I am pretty sure
I it was a pointer problem.

I can not run gdb on my program, it won't work. The code is too hard to
debug by just looking at it. The only way I can debug is to put hundreds
of printf() into the code. That was how I found log( blah ) was making
NAN as well. I have learned to live without a debugger, but it sucks,
because I really need it.







More information about the Linux-audio-dev mailing list