Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/libOpenImageIO/imagebuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,15 @@ ImageBufImpl::~ImageBufImpl()
// how to properly check for errors.
if (!m_err.empty() /* Note: safe becausethis is the dtr */
&& OIIO::pvt::imagebuf_print_uncaught_errors) {
OIIO::print(
"An ImageBuf was destroyed with a pending error message that was never\n"
"retrieved via ImageBuf::geterror(). This was the error message:\n{}\n",
m_err);
try {
OIIO::print(
"An ImageBuf was destroyed with a pending error message that was never\n"
"retrieved via ImageBuf::geterror(). This was the error message:\n{}\n",
m_err);
} catch (...) {
// Swallow any exceptions (e.g., from fmt's fwrite_fully)
// to avoid std::terminate from throwing in a destructor.
}
}
}

Expand Down
13 changes: 9 additions & 4 deletions src/libutil/strutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,15 @@ struct ErrorHolder {
~ErrorHolder()
{
if (!error_msg.empty() && OIIO::pvt::oiio_print_uncaught_errors) {
OIIO::print(
"OpenImageIO exited with a pending error message that was never\n"
"retrieved via OIIO::geterror(). This was the error message:\n{}\n",
error_msg);
try {
OIIO::print(
"OpenImageIO exited with a pending error message that was never\n"
"retrieved via OIIO::geterror(). This was the error message:\n{}\n",
error_msg);
} catch (...) {
// Swallow any exceptions (e.g., from fmt's fwrite_fully)
// to avoid std::terminate from throwing in a destructor.
}
}
}
};
Expand Down
Loading