Overview
IDalamudPlugin is the fundamental interface that all Dalamud plugins must implement. It extends IDisposable to ensure proper cleanup of plugin resources.
Interface Definition
Description
This interface represents a basic Dalamud plugin. All plugins are required to implement this interface to be recognized and loaded by Dalamud.Key Points
- Inheritance: Extends
IDisposable, requiring plugins to implement theDispose()method - Purpose: Serves as the marker interface for all Dalamud plugins
- Cleanup: The
Dispose()method is called when the plugin is unloaded, allowing for proper resource cleanup
Implementation Example
Best Practices
- Always implement
Dispose()properly to clean up resources when the plugin is unloaded - Unsubscribe from all events in
Dispose()to prevent memory leaks - Dispose of any managed resources that implement
IDisposable - Keep the constructor and
Dispose()method as lightweight as possible
Related Interfaces
- IDalamudPluginInterface - Provides access to Dalamud services and functionality
- PluginLoadReason - Indicates why the plugin was loaded