Оболочка для класса C ++ Blah:
EDIT:
ref class BlahWrapper {
BlahWrapper () {
blah = new Blah();
}
!BlahWrapper() { //Destructor called by GC
if (blah != null) {
delete blah;
blah = null;
}
}
~BlahWrapper() { //Dispose() called in "using" blocks, or manually dispose
if (blah != null) {
delete blah;
blah = null;
}
}
private:
Blah* blah;
}