| 413 | } |
| 414 | |
| 415 | void ComputingGraphImpl::ComputingSequence::cleanup() { |
| 416 | #if !__DEPLOY_ON_XP_SP2__ |
| 417 | m_var_sanity_check.reset(); |
| 418 | #endif |
| 419 | if (has_uncaught_exception()) { |
| 420 | mgb_log_warn( |
| 421 | "fallback to simple graph waiting in dtor due to uncaught " |
| 422 | "exceptions"); |
| 423 | if (!m_wait_finished) { |
| 424 | MGB_TRY { |
| 425 | for (auto&& i : m_used_comp_node) { |
| 426 | i.sync(); |
| 427 | } |
| 428 | } |
| 429 | MGB_CATCH(..., {}) |
| 430 | } |
| 431 | } else { |
| 432 | wait(); |
| 433 | } |
| 434 | if (m_owner_graph->m_current_comp_seq == this) { |
| 435 | m_owner_graph->m_current_comp_seq = nullptr; |
| 436 | MGB_TRY { m_owner_graph->clear_device_memory(); } |
| 437 | MGB_CATCH(std::exception & exc, { |
| 438 | mgb_log_error("failed to clear device memory: %s", exc.what()); |
| 439 | }); |
| 440 | } |
| 441 | |
| 442 | // ensure clear user data before destructing m_owner_graph |
| 443 | user_data().clear_all_user_data(); |
no test coverage detected