Share via


Dispose Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Use this method to release resources by the MarketingContext object.

Namespace:  Microsoft.CommerceServer.Marketing
Assembly:  Microsoft.CommerceServer.Marketing.CrossTierTypes (in Microsoft.CommerceServer.Marketing.CrossTierTypes.dll)

Syntax

'Declaration
Public Sub Dispose
'Usage
Dim instance As MarketingContext

instance.Dispose()
public void Dispose()
public:
virtual void Dispose() sealed
public final function Dispose()

Implements

IDisposable..::.Dispose()()()

Remarks

Releases all resources used by the MarketingContext object.

Calling this method allows the resources used by the application context to be reallocated for other purposes.

Call Dispose when you are finished using the MarketingContext. The Dispose method leaves the MarketingContext in an unusable state. After calling Dispose, you must release all references to the MarketingContext so the garbage collector can reclaim the memory that the MarketingContext was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

Note

Always call Dispose before you release your last reference to the MarketingContext. Otherwise, the resources it is using will not be freed until the garbage collector calls the MarketingContext object's Finalize method.

Permissions

See Also

Reference

MarketingContext Class

MarketingContext Members

Dispose Overload

Microsoft.CommerceServer.Marketing Namespace