[poppler] Some C++11 in poppler?

Albert Astals Cid aacid at kde.org
Sun May 29 20:50:49 UTC 2016


Hi guys, what do you think of us adding "some" of the C++11 features in 
poppler?

One that would be useful for example is std::unique_ptr, that is a class that 
will take ownership of a pointer and delete it when it goes out of scope.

That's really useful in poppler where we have lots of

if (!foo) { error; return; }

where we randomly forget to delete stuff.

See the patch Vincent proposed to fix the leak of colorMap in https://
bugs.freedesktop.org/attachment.cgi?id=124163

It's tricky and noone guarantees it will not break next time we introduce 
another check somewhere.

What do you think?

Cheers,
  Albert


More information about the poppler mailing list