.NET的垃圾收集机制不负责回收COM对象,因此要手动对COM对象进行回收,可采用.NET提供的Marshal对象的ReleaseComObject和FinalReleaseComObject来解决。

其中,ReleaseComObject 

Decrements the reference count of the supplied runtime callable wrapper.

FinalReleaseComObject:

Releases all references to a runtime callable wrapper (RCW) by setting the reference count of the supplied RCW to 0.

具体参见以下链接:

 

微软Marshal.ReleaseComObject 方法的来龙去脉

ESRI Developer Network--How to release COM references

.NET+AE开发中常见几种非托管对象的释放

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2021-08-30
  • 2021-06-27
  • 2021-06-02
猜你喜欢
  • 2021-09-14
  • 2021-11-19
  • 2022-12-23
  • 2021-10-04
  • 2021-09-08
  • 2021-06-23
相关资源
相似解决方案