Home > APIs > AppServer API > Changes to GetController()
Changes for GetController()
A memory leak was found in GetController() and now developers need to call Dispose() on the resulting object from GetController(), thereby cleaning up the leaking resources. Developers using builds 184.108.40.2063 & 8.0 or greater, should adhere to the snippet below.
Any code example on this site that does not reflect this code change, are to follow this guideline over the example being examined. On previous builds the developer should be aware that excessive calling in GetController() will result in a gradual memory leak and should be avoided.
// Create our connection. bool newConnection = false; IAppServer iappServer = appServerMgrProxy.CreateAppServer(suiteName, appName, out newConnection); // Get controller - leaking? ISimplePlayerRecorder _playerRecorder = (ISimplePlayerRecorder)connection.AppServerMgr.GetController(index); // Do work // Once the work is finished, call Dispose() ensuring all resources get cleaned up. _playerRecorder.Dispose(); Console.WriteLine("close the AppServer object"); iappServer.CloseConnection();