04-18-2019, 01:54 AM
I'm still poking around, trying to figure out what I can do with Tilengine. I have a question. I used a mapping of the TLN_Init function, and had it output it's return value to an IntPtr in C#. This seems to allow me to run multiple instances of the engine. I was even able to use the TLN_SetContext function with the IntPtr to switch between contexts.
My question is, do I need to be worried about memory leaks, or will the C# garbage collector handle the freeing of the associated memory? If I try to use the TLN_Deinit or TLN_DeleteContext functions, it is possible to crash the Unity Editor while I'm using it. If I don't bother running those functions while in the Editor, it doesn't appear to cause any issues. And the IntPtr type in C# is considered safe, it is likely playing nice with the garbage collector. I wasn't able to find as much documentation about this approach as I would like, and I just wanted to make sure I wasn't doing something that might eat up all my system's resources.
My question is, do I need to be worried about memory leaks, or will the C# garbage collector handle the freeing of the associated memory? If I try to use the TLN_Deinit or TLN_DeleteContext functions, it is possible to crash the Unity Editor while I'm using it. If I don't bother running those functions while in the Editor, it doesn't appear to cause any issues. And the IntPtr type in C# is considered safe, it is likely playing nice with the garbage collector. I wasn't able to find as much documentation about this approach as I would like, and I just wanted to make sure I wasn't doing something that might eat up all my system's resources.