[poppler] Object management helper class

Jakub Kucharski jakubkucharski97 at gmail.com
Mon May 30 21:52:46 UTC 2016


On Mon, 2016-05-30 at 23:32 +0200, Albert Astals Cid wrote:
> If we wanted to do this i guess we would do: 
>  * add destructor with free
>  * call free in the initObj define
>  * Rename shallowCopy to be like "takeObject" that would take the
> internal 
> data and set the other objcet to none
>  * Make operator= private so people are forced to use takeObject
>  * Make free() private so we can easily remove all its uses
> 
> And maybe that would be all?
> 
> Sounds doable-ish?

Removing operator= and free() could be done by using C++11's "= delete"
instead. I think it would be more elegant. Unless we want to use it in
the private methods of course.

If I get your reasoning right, you just want to cause compiler to point
out the places where free() and operator= are used and then correct it
by hand. I think it's a good idea, but perhaps it would be easier if we
took care of the warnings we get now, so we would notice if any new
turned up after the change (aside from genuine errors). Just a thought.

		Jakub


More information about the poppler mailing list