Skip to content

Commit

Permalink
[bugfix] fix crash in windows os, when parallal node return error sta…
Browse files Browse the repository at this point in the history
…tus together.
  • Loading branch information
ChunelFeng committed Dec 13, 2023
1 parent d2e7c59 commit 7adc0da
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/GraphCtrl/GraphPipeline/GPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
}
Expand Down

0 comments on commit 7adc0da

Please sign in to comment.