M
Mark
When declaring a class that uses multiple inheritance, does the order used
when listing the inheritance matter? I'm finding with my compiler (gcc
3.2.2) that my program seg faults when destructing if the order is "wrong".
In my program I use an STL vector to store objects of type Server *. Server
is an abstract base class. When exiting my program I iterate through the
vector and call delete on all my Server objects. One of the concrete Server
objects inherits from both Server and a class called Process. If I declare
the class as:
class MyServer : public Server, public Process
{
};
it's fine, but if I declare it as:
class MyServer : public Process, public Server
{
};
my program seg faults when trying to call the destructor.
Can anyone give me a hint as to what I'm doing wrong?
Thanks,
Mark
when listing the inheritance matter? I'm finding with my compiler (gcc
3.2.2) that my program seg faults when destructing if the order is "wrong".
In my program I use an STL vector to store objects of type Server *. Server
is an abstract base class. When exiting my program I iterate through the
vector and call delete on all my Server objects. One of the concrete Server
objects inherits from both Server and a class called Process. If I declare
the class as:
class MyServer : public Server, public Process
{
};
it's fine, but if I declare it as:
class MyServer : public Process, public Server
{
};
my program seg faults when trying to call the destructor.
Can anyone give me a hint as to what I'm doing wrong?
Thanks,
Mark