## Unload

### Description

Unload is called when the plug-in is unloaded from the cache.

A plug-in is unloaded from the cache when a user right-clicks a plug-in in the plug-in tree and clears the Cached check. This unloads the plug-in (the .dll/.so file, or the script file) from memory, but does not "unload" the plug-in from Softimage. The Plugin and PluginItem objects still exist in Softimage, and the plug-in is still registered.

When a plug-in is not cached, it is loaded and unloaded every time a plug-in item (such as a command) is invoked. This triggers the Reload and Unload callbacks.

Softimage releases any user data stored in the context after the Unload callback returns. Softimage also releases the user data after Term returns.

### Applies To

All plug-in items except Custom Properties.

### Syntax

    public class <plugin-item_name>

    {

    	public bool Unload( Context in_context )

    	{

    		...

    	}

    }

    CStatus <plugin-item_name>_Unload( CRef& in_context )

    {

    	...

    }

    function <plugin-item_name>_Unload( in_context )

    {

    	...

    }

    def <plugin-item_name>_Unload( in_context ):

    	...

    Function <plugin-item_name>_Unload( in_context )

    	...

    End Function

    sub <plugin-item_name>_Unload

    {

    	my $in_context = shift;

    }

<plugin-item-name> is the name specified in XSILoadPlugin, with any spaces converted to underscores.

### Parameters

Parameter | Language | Type | Description
in_context | Scripting and C# | Context | Context.Source returns the plug-in item.
| C++ | CRef& | A reference to the Context object.

### See Also

- Reload
- XSILoadPlugin
- XSIUnloadPlugin
- Init (Command)
- Init (Custom Display)
- Init (Filter)
- Init (Menu)