Made sure vertexBuffer is initially NULL.
Ensured buffer is generated.
Trying to debug a memory error somewhere: switched to direct Object pointers.
Fixed: I had instance variables and parameters the wrong way around. Also fixed memory leak now that shared_ptr is out of the picture.