|
问题是这样的,我在使用\ACE_wrappers\examples\APG\Reactor下的例子HAStatus时在- int
- ClientService::handle_close (ACE_HANDLE, ACE_Reactor_Mask mask)
- {
- if (mask == ACE_Event_Handler::WRITE_MASK)
- return 0;
- lock_.acquire(); //增加这里
- mask = ACE_Event_Handler::ALL_EVENTS_MASK |
- ACE_Event_Handler::DONT_CALL;
- this->reactor ()->remove_handler (this, mask);
- this->sock_.close ();
- this->output_queue_.flush ();
- delete this;
- lock_.release();//在增加这里
- return 0;
- }
复制代码 本来是想改成TP_Reactor防止多次删除,但是奇怪的问题发生了
在Client第二次连接的时候发生错误
HEAP[HAStatus.exe]: HEAP: Free Heap block 96c110 modified at 96c190 after it was freed
Unhandled exception at 0x7c94a3e1 in HAStatus.exe: User breakpoint.
跟踪进去也没发现错误,继续运行结果仍然正常,请大家为我解疑
我测试的平台
Windows XP SP2
Vc++ 2003
ACE 5.6.0
thks |
|