Proper use of the IDisposable interface

后端 未结 19 3259
情深已故
情深已故 2020-11-21 04:05

I know from reading the Microsoft documentation that the \"primary\" use of the IDisposable interface is to clean up unmanaged resources.

To me, \"unman

19条回答
  •  广开言路
    2020-11-21 05:04

    If you want to delete right now, use unmanaged memory.

    See:

    • Marshal.AllocHGlobal
    • Marshal.FreeHGlobal
    • Marshal.DestroyStructure

提交回复
热议问题