From 7adc0dadcbef1b8e35eee77df76cdf61c0b5be38 Mon Sep 17 00:00:00 2001 From: ChunelFeng Date: Wed, 13 Dec 2023 22:37:17 +0800 Subject: [PATCH] [bugfix] fix crash in windows os, when parallal node return error status together. --- src/GraphCtrl/GraphPipeline/GPipeline.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/GraphCtrl/GraphPipeline/GPipeline.cpp b/src/GraphCtrl/GraphPipeline/GPipeline.cpp index 1294e799..27a8981f 100644 --- a/src/GraphCtrl/GraphPipeline/GPipeline.cpp +++ b/src/GraphCtrl/GraphPipeline/GPipeline.cpp @@ -56,7 +56,8 @@ CStatus GPipeline::run() { * 1. 将所有 GElement 的状态设定为 NORMAL * 2. 将所有的 GParam 设置为初始值 * 3. 执行dag逻辑 - * 4. 将所有的 GParam 复原 + * 4. 将所有 GElement 的状态恢复为 NORMAL + * 5. 将所有的 GParam 复原 */ status += repository_.setup(); status += param_manager_->setup(); @@ -75,16 +76,20 @@ CStatus GPipeline::destroy() { CGRAPH_ASSERT_INIT(true) CGRAPH_ASSERT_NOT_NULL(element_manager_, param_manager_, daemon_manager_, event_manager_) + /** + * 需要先将线程池相关内容析构,然后再做destroy。 + * 否则的话,在错误status累积的情况下,在windows平台上,会产生崩溃 + */ + status += repository_.destroy(); + status += schedule_.destroy(); + CGRAPH_FUNCTION_CHECK_STATUS + status += event_manager_->destroy(); status += daemon_manager_->destroy(); status += element_manager_->destroy(); status += param_manager_->destroy(); CGRAPH_FUNCTION_CHECK_STATUS - status += repository_.destroy(); - status += schedule_.destroy(); - CGRAPH_FUNCTION_CHECK_STATUS - is_init_ = false; CGRAPH_FUNCTION_END }