Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RAII Exiv2::Library to init/free resources #1022

Open
piponazo opened this issue Oct 6, 2019 · 1 comment
Open

Add RAII Exiv2::Library to init/free resources #1022

piponazo opened this issue Oct 6, 2019 · 1 comment
Labels
refactoring Cleanup / Simplify code -> more readable / robust
Milestone

Comments

@piponazo
Copy link
Collaborator

piponazo commented Oct 6, 2019

As it was discussed in #977 , the idea would be to add in master a RAII class named Exiv2::Library (or better name) which would take care of allocating/freeing library resources in a RAII fashion. At least we should have there the calls to the XmpParser::initialize() and XmpParser::terminate in case the XMP support is enabled.

@clanmills
Copy link
Collaborator

We should investigate this for v1.00. As we have a new API for v1.00, we can "clean up" some of those legacy issues.

I know Andreas was strongly against having a library initialisation function. His argument is that all that an application needs is to include <exiv2/exiv2.hpp> and it can call Exiv2 library functions. And he's right. That will work. However, it's better architecture to have process singleton.

If a developer is using Exiv2 in a large/complex application, he may be unable to modify 'main' to host the singleton. That's regrettable. It's not catastrophic.

The use of the singleton is desirable. It should not be compulsory.

@clanmills clanmills added refactoring Cleanup / Simplify code -> more readable / robust and removed good first issue labels Apr 13, 2021
@kevinbackhouse kevinbackhouse modified the milestones: v0.28.0, Backlog Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Cleanup / Simplify code -> more readable / robust
Projects
None yet
Development

No branches or pull requests

4 participants