Hi Petr,
I will be honest, I have never understood why the destructor should be protected and non-virtual. Even I had read the articel again.
http://www.gotw.ca/publications/mill18.htm
But maybe you can it explain more in detail.
That you should never derived from a class with a non-virtual destructor comes from Scott Meyers new book “Effective C++” http://www.amazon.com/o/ASIN/0321334876/ref=s9_asin_image_1/102-7425015-1366538?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-4&pf_rd_r=0SVN09DCNHRQ808H0Z88&pf_rd_t=101&pf_rd_p=278841901&pf_rd_i=507846
But I have the new version on work and not here.
I have now checked the documentation about QSharedData. It seems that it is designed for a base class. But this makes no sence for me. How should the compiler knows to call the right destrutor if there is no virtual talble?
QSharedData* pData = new DerivedQSharedData;
delete pData; // ???
Regards,
Markus
