Most Valued User JoergG Posted August 10, 2018 Most Valued User #1 Share Posted August 10, 2018 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 More sharing options...
Most Valued User Sebastian Dreier Posted August 10, 2018 Most Valued User #2 Share Posted August 10, 2018 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.