forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Error retrieval safeguards for recycled objects (AcademySoftware…
…Foundation#4239) The recent switch from boost thread_specific_ptr left a bug: if an ImageInput (say) is deleted without the caller clearing its error state, and then later another ImageInput is allocated and happens to get the same address as the first one, it can "inherit" the unretrieved error state left behind by the other. Fix by using a unique ID (initialized by an incrementing atomic counter) to index the object in the per-thread error store. I feel like we still don't have a foolproof replacement for the really nice lifetime management that thread_specific_ptr was doing for us. One could argue that unretrieved errors in an object are a "bug" in the user's program, but unretrieved bugs currently just accumulate in the map, even after the ImageInput is destroyed, until the thread terminates. --------- Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
5 changed files
with
46 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters