Does OpenGL deallocate the resources for me?, With instanced rendering

I was trying to make an editing application based on OpenGL, and I have a vbo that hold the transformation matrices in it and then I use instanced rendering to draw all the instances for me, so if the user desired to add a new object; I have to resize the buffer, how would I do that?
By deleting the old buffer and generate new one then fill it with old data and add the new data?
Or just call glbufferdata without worrying about the buffer size?
Or there is a better idea to do what I wanted to?

I was trying to make an editing application based on OpenGL, and I have a vbo that hold the transformation matrices in it and then I use instanced rendering to draw all the instances for me, so if the user desired to add a new object; I have to resize the buffer, how would I do that?

that ("user input") means the buffer doesnt have to be resized that frequently ...
you can pre-allocate a buffer large enough that can hold all the comming transformation matrices (100 or so). if you need more matrices, just re-allocate (lets say double) its size for the time the app runs, by calling:

actually I am using glGenBuffers(...), so; is glDeleteBuffers() valid for the generated buffer?
and what is the difference between glGenBuffers(...) and glCreateBuffers(...)?

glGenBuffers() creates buffer "handles", these dont exist until you bind the to a target the first time, glCreateBuffers() creates existing buffers (without having to bind them), glDeleteBuffers() deletes all buffer "handles" (regardless how they were created, glGen* or glCreate*)

Originally Posted by Omar Bsoul

could you please explain how GL context being destroyed?

when your GL window gets destroyed, the GL context gets also destroyed, and with it all the buffers / textures / etc