Jump to content

Difference between .FreeForReuse() and .Dispose()


JoergG

Recommended Posts

  • Most Valued User

Hi Comminity,

 

What ist the difference between .FreeForReuse() and .Dispose() ?

Or what is the best practice to delete or get free my used ressources on libmanager, adminfacade and so on...

 

Deutsch:

Wo ist der Unterschied zwischen den Methoden .FreeForReuse() und .Dispose() z.b. beim Libmanager oder der Adminfacade.

Oder wie kann ich meine Ressourcen am besten wieder frei geben..

 

Best Regarts

Jörg

Link to comment
Share on other sites


  • Most Valued User

Hello Jörg,

 

the method "FreeForReuse" is a Swyx implementation to release resource on the IpPbx Server.
The Dispose method is just the normal C# IDispose implementation and has no effect on the IpPbx Server.

 

I highly recommend to call the "Clear" and "FreeForReuse" method for every Enum object.

For LibManager and Facade objects only the "FreeForReuse" method should be called.

 

Examples:

// LIB MANAGER INIT
var libManager = new LibManager()
{
    BaseProtocol = SProxyObject.BaseProtocol.TCP,
    Username = "Username",
    Password = "Password",
    WSBaseUrl = "ServerAddress",
    AuthenticationMode = SProxyObject.AuthenticationMode.UsernamePassword
};
        
var adminFacade = libManager.GetAdminFacade();
// SOME FACADE METHODS CALLS
adminFacade.FreeForReuse();
adminFacade = null;

var userEnum = this.libManager.GetUserEnum();
// SOME ENUM METHODS CALLS
userEnum.Clear();
userEnum.FreeForReuse();
userEnum = null;

// LIB MANAGER CLEANUP
libManager.FreeForReuse();
libManager = null;

 

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.