I have a managed object in a C++/CLI assembly. Being C++/CLI, it implements the Disposable pattern through its "destructor" (yes, I'm aware it's not the same as a standard C++ destructor). From C++/CLI, I would simply
the object. However, I am using this object as a member variable in a C# class.
From my C# class, then, I would like to call the equivalent of the Dispose() method on the C++/CLI object when I am finished using it. Since it is (and must be) a member variable of the class, utilizing a using() block is out of the question. As far as I can tell, there is no exposed method for direct, deterministic disposal of resources from a language other than C++/CLI. How can I accomplish this?