Hi Nomad,
No, they are not. You have to call them manually. It was a design decision, and something that you usually do in that way in C++ frameworks. And I tell you why:
If you pass an object (for example a Surface) to a method or function, not a pointer to it, but the object, or a reference to it, something like this:
- Code:
Surface surface;
surface.create(TEXT("image.png");
useMySurface(surface);
If the free() method is being called by the destructor, then you could not use the surface instance after you call "useMySurface" function, because when you reach the end of that function, the destructor of the parameter copy of surface will be called, and as they share the same buffer, this buffer will be deallocated, and the original surface instance can not be used anymore.
Now, this (implementing a free() method on every GledPlay class) is not the only solution to the problem, but we though it was the better one.
Best Regards,
Sergio.