In OpenGL tutorials I never saw that someone call glDeleteFramebuffers
before program finished.
Should I delete FrameBuffer before close application? Or OpenGL driver will do this for me?
P.S. Same question about texture glDeleteTextures
.
The driver will free all resources associated with the OpenGL objects of a process when that process exits. You don't have to worry about system wide leaks if an application exits without cleaning up.
Even though the mechanisms are different, the behavior is very much like what happens with memory allocations. If you don't free all your dynamically allocated memory before exiting, all the memory that the application allocated will still be returned to the system. (*)
Still, I think it's generally good style to explicitly clean up all resources before exiting. It can also be helpful if you use tools that detect memory leaks.
(*) I'm talking about modern, full-featured operating systems here like they would typically be used on a desktop computer, a smart phone, or a tablet. I can imagine that this might not be true on minimal operating systems.