✅ Looking for guidance with P/Invoke and unmanaged resources
I'm starting to dip my toes into P/Invoke and using unmanaged resources, and I'd like to hear if I'm doing anything particularly wrong or bad practice.
I've got a test class in my C++ dll with an int32 member, and a couple functions to heap allocate and destroy it, and some functions that take a pointer to the class and call its respective methods:
I've got a test class in my C++ dll with an int32 member, and a couple functions to heap allocate and destroy it, and some functions that take a pointer to the class and call its respective methods: