Posts Tagged finalizer

C++ Scripting: Part 29 – Factory Functions and New MonoBehaviours

Tags: , , , ,

Since their introduction in part 7, support for C++ MonoBehaviour messages has always been a special case. The reason for this was that we didn’t have good enough support for what I’m calling “factory functions.” These are functions like GameObject.AddComponent<T> that instantiate a generic type. This week we’ll go over why that support was lacking, what was done to fix it, and how the new system works.

Read the rest of this article »

No Comments

From AS3 to C#, Part 18: Resource Allocation and Cleanup

Tags: , , , , ,

Today we continue the series by looking at how resources—primarily memory—are acquired and cleaned up in C#. We’ll go way beyond the new operator and discuss advanced features like finalizers and using blocks that can make releasing resources much less prone to errors. Read on to learn!

Read the rest of this article »

No Comments