What problem does it solve?
This Skill audits resource management to ensure proper cleanup of OpenGL resources, correct IDisposable implementation, and prevention of memory leaks. It focuses on critical engine-specific concerns like OpenGL context safety, factory ownership patterns, and GPU resource tracking, which are vital for stable and performant game execution.
Core Features & Use Cases
- IDisposable Verification: Checks for correct
IDisposable implementation, including _disposed flags, resource ID resets, and GC.SuppressFinalize.
- OpenGL Context Safety: Enforces the rule that OpenGL calls must never occur in finalizers to prevent crashes.
- Ownership Clarity: Distinguishes between factory-managed (shared) and component-owned resources to prevent premature disposal.
- Memory Leak Detection: Identifies missing disposal paths for resources created in loops or without explicit cleanup.
- Use Case: When investigating a GPU memory leak that occurs after repeatedly loading and unloading scenes, this Skill can audit
Mesh and Texture classes to ensure their OpenGL IDs are correctly deleted and that shared resources are not prematurely disposed by individual components.
Quick Start
Audit the Texture class for proper IDisposable implementation, ensuring GL.DeleteTexture is called correctly and GC.SuppressFinalize is used.