C ++应用程序无法在64位Windows上关闭(僵尸进程?) [英] C++ Application Doesn't Close On 64-bit Windows (Zombie Process?)

查看:305
本文介绍了C ++应用程序无法在64位Windows上关闭(僵尸进程?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从父应用程序中启动的子应用程序.当我通过父母关闭孩子时,一切都会好起来的.

但是,在64位Windows操作系统上,如果我自行关闭子级,则有50/50的可能性无法正确关闭子级.

通过父母关闭孩子可以使孩子工作100%.但是,如果我通过单击"X"关闭孩子,则GUI关闭,但进程仍在任务管理器中运行.

附加信息:当我运行应用程序的调试版本时,不会发生此问题.现在,我在想也许我没有释放出一些资源.

有没有人看到这种行为并知道如何解决?

谢谢!
Alex

解决方案

我以前从未见过.也许您的应用程序有一些错误.


很可能是一个错误在我们的应用程序中.但是,我仍然不确定会导致这种行为的错误类型.我怀疑64位和32位版本的Windows在析构函数中有所不同,也许某些句柄并非总是正确释放.

为了说明问题,我们的应用程序使用了很多传统技术,例如. Borland OWLNext,DDE等.并且已经有很多关于类似问题的报道,但是通常在开发者论坛上都没有报道.

如果有人想让我进一步澄清问题,请告诉我.谢谢!


我想我现在可以解决它.该过程似乎挂在删除CControlBar对象上.

注释掉它可以正常工作,也可以将其移到块中的更高位置.

仍然,作为一种学习经验,我想问问是否有人知道为什么会发生这种情况,为什么只在64位OS上?


I have a child application launched from within a parent application. When I close the child through the parent, everything is fine and dandy.

However, on 64-bit Windows OS, if I close the child on its own, there''s a 50/50 chance that it won''t close properly.

Closing the child through the parent will work 100%. But if I close the child by clicking the ''X'', the GUI is closed but the Process remains running in Task Manager.

Additional information: when I run the debug version of the application, the problem doesn''t occur. Right now I''m thinking it maybe some resources that I''m not freeing up.

Has anyone seen this behaviour and know how to resolve it?

Thanks!
Alex

解决方案

I have never seen this before.Maybe your application has some mistakes.


It may very well be a mistake within our application. However, I''m still not sure what kind of errors would result in this behaviour. I''m suspecting something in the destructor different between the 64 and the 32 bit versions of windows, and perhaps some handles aren''t always released properly.

To put things in context, our application are using a lot of legacy technology, eg. Borland OWLNext, DDE, etc. And there have been quite a few reports of similar problems, but those normally aren''t reported on a developer forum.

If anyone would like me to clarify the problem a bit more, please let me know. Thanks!


I think I''m able to resolve it now. The process appears to hang on the deletion of a CControlBar object.

Commenting it out works fine, as well as moving it to a later position in the block.

STILL, as a learning experience, I''d like to ask if any one knows why this might happen, and why only on a 64-bit OS?


这篇关于C ++应用程序无法在64位Windows上关闭(僵尸进程?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆