Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
oiiotool: work around static destruction order issue (AcademySoftware…
…Foundation#3295) (AcademySoftwareFoundation#3591) In some cases (at least on Windows, with static linking) the oiiotool main returns zero, but the full process returns 3 error code due to abort() being called. And that is called because a global shared image cache is already destroyed, but the image references from another global (Oiiotool itself) try to use it, get a call into a "pure virtual function" stub that is put by MSVC C runtime into a destroyed object vtable, and that ends up in an abort(). Work around that by making sure various member variables holding ImageRecRef are cleared before main() finishes and global destructors are called.
- Loading branch information