Login  Register

Re: glDeleteBuffers Very Inconvenient.

Posted by millerni456 on Jan 22, 2013; 11:11pm
URL: https://forum.jogamp.org/glDeleteBuffers-Very-Inconvenient-tp4027988p4027989.html

Hey all,

I found an interesting article regarding Java's garbage collection.

It said this: "A finalizer in Java is the opposite of a constructor. While a constructor method performs initialization for an object, a finalizer method performs finalization for the object. Garbage collection automatically frees up the memory resources used by objects, but objects can hold other kinds of resources, such as open files and network connections. The garbage collector cannot free these resources for you, so you need to write a finalizer method for any object that needs to perform such tasks as closing files, terminating network connections, deleting temporary files, and so on."

URL: http://docstore.mik.ua/orelly/java-ent/jnut/ch03_03.htm

So I wonder if grabbing an instance in the finalize method would create a performance drop as I had worried about earlier.
If it does, at least I can still do what I did in my last game in a more abstract way!