Project

General

Profile

Bug #205

做定值组控制的时候,程序闪退

Added by shixun yan over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Assignee:
shixun yan
Target version:
Start date:
07/16/2019
Due date:
% Done:

100%

Estimated time:
Defect version:

Description

做定值组控制的时候,脚本里面执行Pause(3000)的动作,此时频繁的在图片上点击图元,程序会闪退.

pause函数允许程序继续响应 MOUSEMOVE, 相应的处理函数会影响到正在执行的脚本线程,尤其是GWnd::m_shapeid,造成后续的指针转换时错误。

修改: 调用Pause时,程序对 MOUSEMOVE的响应处理进行屏蔽

History

#1

Updated by xiangyang li over 5 years ago

  • Description updated (diff)
  • Target version changed from 2.2.3 to 2.2.2 sp1
#2

Updated by shixun yan over 5 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

脚本执行Pause的时候,会PeekMessage,但是WM_MOUSEMOVE并没有被拦截,
在Pause执行过程中,如果移动鼠标,会频繁的调到GWnd里面PointSelect函数.
脚本执行是个耗时操作,执行的代码在
if (g_ehmiMainFrame->m_bScript && pObj->GetScriptLen() > 0 && pObj->GetStyle() & OS_ENABLED) {
if (flag == lbtn_up) {
if (RBAC_CheckPrivilege(DEF_RIGHT_OPERATOR)) {
BeginWaitCursor(); // display the hourglass cursor

m_pCurObj = pObj;
if (m_shapeid == OS_BUTTON) {
if (pObj->IsObjectMouseIn()) {
m_pView->m_Script.ExecString((const char *)pObj->m_pScriptData, this);
}
}
else {
m_pView->m_Script.ExecString((const char *)pObj->m_pScriptData, this);
}
m_pCurObj = NULL;
EndWaitCursor();    // remove the hourglass cursor
}
m_runScript = TRUE;
}
else if (flag == mouse_move)
m_runScript = TRUE;
}

等这个脚本执行完毕,m_shapeid所指向的内存已经变了, 后续在做
CPointDevice *pdev = (CPointDevice *)pObj;
m_pObjSelect = pdev;
pdev->GetDevInfo(m_seldev);
的时候,就会出错0x0000005错误.
程序闪退.

#3

Updated by xiangyang li over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF