Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Security.Cryptography.X509Certificates;
using System.Xml.Serialization;

namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Model
{
public class PersistentVM : IPersistentVM
public class PersistentVM : IPersistentVM,IDisposable
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a space after the comma.

{
public string AvailabilitySetName
{
Expand Down Expand Up @@ -131,6 +132,33 @@ public PersistentVM GetInstance()
{
return this;
}

public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
{
if (disposing)
{
//Free managed resources
ResourceExtensionReferences = null;
DataVirtualHardDisksToBeDeleted = null;
X509Certificates = null;
WinRMCertificate = null;
ConfigurationSets = null;
DataVirtualHardDisks = null;
OSVirtualHardDisk = null;
}
//Free unmanaged resources
}

~PersistentVM()
{
Dispose(false);
}
}
}