Skip to content

fix: Close Builder after signing#269

Open
tmathern wants to merge 3 commits into
mainfrom
mathern/fix-leak
Open

fix: Close Builder after signing#269
tmathern wants to merge 3 commits into
mainfrom
mathern/fix-leak

Conversation

@tmathern
Copy link
Copy Markdown
Collaborator

@tmathern tmathern commented May 29, 2026

Changes in this pull request

  • Close Builder to force resources clean up
  • A Builder should not be reused for multiple signing anyway

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

@tmathern tmathern requested a review from gpeacock May 29, 2026 02:25
@tmathern tmathern self-assigned this May 29, 2026
@tmathern tmathern requested a review from ok-nick May 29, 2026 02:25
Comment thread src/c2pa/c2pa.py
Comment on lines +3532 to +3537
# Sign borrows the Builder without taking ownership.
# Closing here ensures resources clean up,
# and single use/single sign done by a Builder.
self.close()
except Exception as e:
self._mark_consumed()
self.close()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make sure this is documented in the function signatures just so it's not a surprise to anyone?
(not sure if that's done already or is any different from what we had previously)

Copy link
Copy Markdown
Contributor

@ok-nick ok-nick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving given the previous comment is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants