Try PubSub+

Dispose ITopic?

radekmradekm Member Posts: 4

Hi,
when using Solace from C# / F# I found out that ITopic is IDisposable. But in the tutorials (eg. https://solace.com/samples/solace-samples-dotnet/publish-subscribe/) the topics are not disposed.

So should I dispose them or it's not necessary and not disposing won't create resource / memory leak?

Thanks

Comments

  • RagnarRagnar Member, Employee Posts: 3 Solace Employee

    Hi,
    IDisposable objects more efficiently release unmanaged memory when Dispose() is called. This guarantees memory is returned to the heap as soon as possible. That said, the Solace C# API will call Dispose() on your behalf if you allow the object to be garbage collected. There won't be a resource or memory leak.

    Hope that helps.
    Ragnar

Sign In or Register to comment.