Skip to content

Commit

Permalink
投递UI消息改为PostMessage方式,否则Task运行时还是在原有线程中
Browse files Browse the repository at this point in the history
Signed-off-by: 李功健10107835 <[email protected]>
  • Loading branch information
ligongjian committed Feb 23, 2017
1 parent 31e500e commit a4811ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions DuiVision/source/DlgBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1854,6 +1854,10 @@ LRESULT CDlgBase::OnMessageUITask(WPARAM wParam, LPARAM lParam)
pTask->TaskNotify(pTaskMgr, DuiVision::IBaseTask::TE_Canceled);
}
}
if (pTask != NULL)
{
pTask->Release();
}
return bRet;
}

Expand Down
3 changes: 2 additions & 1 deletion DuiVision/source/DuiSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,8 @@ int DuiSystem::RunUITask(DuiVision::IBaseTask* pTask, const DuiVision::CTaskMgr*
return FALSE;
}

return pDlg->SendMessage(WM_UI_TASK, (WPARAM)pTask, (LPARAM)pTaskMgr);
pTask->AddRef();
return pDlg->PostMessage(WM_UI_TASK, (WPARAM)pTask, (LPARAM)pTaskMgr);
}

//
Expand Down

0 comments on commit a4811ce

Please sign in to comment.