[poppler] Adding private unimplemented copy constructor and operator= to non copiable classes

Albert Astals Cid aacid at kde.org
Sun May 4 05:55:34 PDT 2008


Some poppler core classes have members that are pointers. This classes were 
not meant to be copied so we don't have copy constructors nor operator=. That 
does not mean one can not call them as C++ provides default copy constructor 
and operator=. These default operations do plain assignment. This is usually 
wrong for members that are pointers. So i'm asking wheter we want to add 
unimplemented copy constructor and operator= to that kind of classes that are 
not meant to be copiable to ensure someone does not messes up using the 
default operations.

As an example you can see AnnotQuadrilaterals that has quadrilaterals created 
on constructor and deleted on destructor, if someone uses the default copy 
constructor or the default operator= that would result in a double free on 
deletion of the second object.

Comments?

Albert


More information about the poppler mailing list