04-20-2019, 06:56 AM
(This post was last modified: 04-20-2019, 07:01 AM by Richard Kain.)
Big thanks, megamarc! I dug a little deeper into the documentation for the IDisposable interface, and I think that's got me where I needed to be. Here's a link to the documentation I used. It provides a pretty good example of how to tie memory management into a manual approach as well as a standard garbage collector approach. I was able to cook up a quick prototype class and script that handles the object creation, destruction, and disposal, and was able to get it calling the necessary DeleteContext function without any fuss and without any crashes in the Editor. I should be able to integrate this into the project I'm working on easily enough. I'm feeling a lot better about the memory management side of things.
One last quickie question, I don't need to call both DeleteContext and Deinit, do I? If I'm reading the documentation correctly, Deinit is used to delete the currently assigned context without providing a pointer, so I should be able to call one or the other, but shouldn't need to call both. Especially if I'm being careful about my instances, and disposing of my contexts correctly.
One last quickie question, I don't need to call both DeleteContext and Deinit, do I? If I'm reading the documentation correctly, Deinit is used to delete the currently assigned context without providing a pointer, so I should be able to call one or the other, but shouldn't need to call both. Especially if I'm being careful about my instances, and disposing of my contexts correctly.