Deallocation of VBOs

Hi there,

What is the recommended practice for the deallocation of VBOs please? Specifically I am interested in this feature when cleanly removing objects from a scene as well as elegantly closing down an application. At the moment, I am deallocating with the following line of code:

gl.glDeleteBuffersARB(1,glID,0);

On the ATI X1800 (Mac OS X, Intel, Leopard) this quickly causes strange vertex artifacts and frame-rate drops when working with a large number of VBOs (the IDs are valid and no exception is thrown). If a VBO deallocation strategy is not adopted, everything is fine, but I assume that this will eventually clog up the card unless the context is destroyed.

Many thanks for your input.

I’m also seeing crashes on other operating systems and GPUs, so this could be a bug in the application (so far I haven’t found one - still looking). As far as I can tell at this stage, it seems that deallocating a large number of specific VBOs can sometimes cause glDrawElements to crash on NVIDIA and strange things to happen on ATI cards.