Skip to content

Conversation

@kekaczma
Copy link

UR_CHECK_ERROR may throw or abort, which is unsafe to use from a destructor. If an exception escapes during stack unwinding, std::terminate would be called.

Replace UR_CHECK_ERROR in ur_context_handle_t_ destructor with a non-throwing, best-effort cleanup. In debug builds, failures are reported via assert/log, while release builds avoid throwing from the destructor.

This fixes Coverity CID 519631, issue: [Coverity][UR] Potentially throwing function is called from a destructor

UR_CHECK_ERROR may throw or abort, which is unsafe to use from a destructor.
If an exception escapes during stack unwinding, std::terminate would be called.

Replace UR_CHECK_ERROR in ur_context_handle_t_ destructor with a non-throwing,
best-effort cleanup. In debug builds, failures are reported via assert/log,
while release builds avoid throwing from the destructor.

This fixes Coverity CID 519631, issue: [Coverity][UR] Potentially throwing function is called from a destructor
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