Skip to content

Conversation

@benstevens48
Copy link

Technically the singleton DefaultWicAdapter instance was not thread-safe when creating the WIC factory. Similarly, the DefaultCanvasImageAdapter was not thread-safe when storing a copy of the WicAdapter instance. In the second case in practice it probably was thread-safe anyway assuming setting a pointer is atomic. In the first case it would probably have been very difficult to hit a serious issue, although potentially it could have leaked the factory object and potentially returned a different instance on different calls.

This pull request fixes that by using std::call_once.

@MartyIX
Copy link

MartyIX commented Jul 16, 2024

Will this get merged please?

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.

3 participants