使用TRESTClient关闭时异常终止程序 [英] Abnormal program termination on shutdown with TRESTClient

查看:188
本文介绍了使用TRESTClient关闭时异常终止程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当关闭具有TRESTClient组件的程序时,将显示程序异常终止"错误.

When a program that has a TRESTClient components is shutdown, it will show an "Abnormal Program Termination" error.

最近,我们将一个项目从C ++ Builder 2009升级到了C ++ Builder 10.2 Tokyo.之后,我们将新的TRESTClient添加到我们的项目中.现在,每次我们尝试关闭应用程序时,它都会显示此错误.这意味着可能会进行abort()调用.

Recently, we've upgraded a project from C++Builder 2009 to C++Builder 10.2 Tokyo. Afterwards, we added the new TRESTClient to our project. Now, every time we try to close the application, it shows this error. This means that an abort() call is probably made.

我们一直运行调试器,直到tWinMain()函数结束为止,这表明它在返回之后发生.这表明在应用程序清理期间引发了异常.在包含的调用堆栈中,它显示Data::Bind::Objectscope::Finalization,并且UnregisterScope()从那里被调用.抛出异常的可能性最大.

We've run the debugger until the end of the tWinMain() function, which shows that it happens after the return. This shows that the exception is thrown during application cleanup. In the included call stack, it shows Data::Bind::Objectscope::Finalization, and UnregisterScope() being called from there. This is most likely where the exception is thrown.

此问题似乎与此论坛帖子中的问题非常相似.雷米·勒博(Remy Lebeau)将其描述为一个错误,在该错误中,如果在注销时未找到任何项目,则会引发异常.

This problem seems very similar to the issue in this forum post. Remy Lebeau describes this as a bug where, if an item is not found while unregistering, an exception is thrown.

推荐答案

自10.3.2起已修复: 要在较旧版本中进行修复,请执行以下操作:

问题与两个库("bindengine.lib"和"bindcomp.lib")的链接顺序有关.

The issue has to do with the link order of two libraries, namely "bindengine.lib" and "bindcomp.lib".

当在"bindengine.lib"之前链接"bindcomp.lib"时,您将看到此问题,并且由于某些令人沮丧的原因,IDE坚持将它们以错误的顺序放置.因此解决了这个问题.

When "bindcomp.lib" is linked in BEFORE "bindengine.lib" you will see this problem, and for some frustrating reason the IDE insists in placing the them in wrong order. So to resolve the issue.

  1. 关闭在IDE中显示问题的项目.
  2. 将项目的.cbproj加载到文本编辑器中(提示:不是IDE)
  3. 搜索"标签.
  4. 切换两个库"...; bindengine.lib; bindcomp.lib; ..."的位置,以使"bindengine"在"bindcomp"之前.
  5. 对其他任何"重复该过程(因为您可能有多个配置)
  6. 对于标签"重复3到5.
  7. 保存项目文件.
  8. 在IDE中将其打开,然后再次进行构建或清理并制作"项目.这样,EXE就可以重新链接了.

这篇关于使用TRESTClient关闭时异常终止程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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