Destructor question

Hello,

I implemented class destructor as doing nothing that is:

 
	inline ~ChannelFlow(){};


It seems that during runtime this destructor still calling destructors of its members. Thus there is FESystem<2, 2> type field in class ChannelFlow.

Is it normal that empty desctructor is calling destructors for all members of the class or I don't understand smth?
This class is destroyed only if the program is over, therefore there I made the destructor empty.
I am trying to understand the following stacktrace:

1
2
3
4
5
Stacktrace:
#0  /home/ubuntu/deal.II/installedWithExtrnlBOOST/lib/libdeal_II.g.so.8.2.1: dealii::Subscriptor::~Subscriptor()
#1  /home/ubuntu/deal.II/installedWithExtrnlBOOST/lib/libdeal_II.g.so.8.2.1: dealii::FiniteElement<2, 2>::~FiniteElement()
#2  /home/ubuntu/deal.II/installedWithExtrnlBOOST/lib/libdeal_II.g.so.8.2.1: dealii::FESystem<2, 2>::~FESystem()
#3  ./main: ChannelFlow<dealii::Vector<double>, dealii::SparseMatrix<double> >::~ChannelFlow()
#4  ./main: main


Last edited on
Is it normal that empty desctructor is calling destructors for all members of the class or I don't understand smth?


Yes. Destructors are always called when the object is destroyed.

1) Your class's dtor body (if present) is called
2) dtors for all members are called
3) repeat steps for parent classes
Thank you!
Topic archived. No new replies allowed.