<commit_before>#include <OGL/OGLGpuBuffer.h>

std::vector<GLBufferId> OGLHgGPUBuffer::m_useableBufferIds;


GLBufferId::~GLBufferId()
{
	if (buffId > 0) {
		glDeleteBuffers(1, &buffId);
		glDeleteTextures(1, &texId);
	}
	texId = 0;
	buffId = 0;
}

void GLBufferId::AllocateOnGPU()
{
	if (texId == 0) {
		glGenBuffers(1, &buffId);
		glGenTextures(1, &texId);
	}
}

GLBufferId::GLBufferId(GLBufferId&& rhs)
{
	*this = std::move(rhs);
}

const GLBufferId& GLBufferId::operator=(GLBufferId&& rhs)
{
	std::swap(buffId, rhs.buffId);
	std::swap(texId, rhs.texId);
	return *this;
}



GLBufferId OGLHgGPUBuffer::getGLBufferId()<commit_msg>Fix bug causing deletion of buffers<commit_after>#include <OGL/OGLGpuBuffer.h>

std::vector<GLBufferId> OGLHgGPUBuffer::m_useableBufferIds;


GLBufferId::~GLBufferId()
{
	if (buffId > 0) {
		glDeleteBuffers(1, &buffId);
		glDeleteTextures(1, &texId);
	}
	texId = 0;
	buffId = 0;
}

void GLBufferId::AllocateOnGPU()
{
	if (texId == 0) {
		glGenBuffers(1, &buffId);
		glGenTextures(1, &texId);
	}
}

GLBufferId::GLBufferId(GLBufferId&& rhs)
{
	*this = std::move(rhs);
}

const GLBufferId& GLBufferId::operator=(GLBufferId&& rhs)
{
	buffId = rhs.buffId;
	texId = rhs.texId;

	rhs.buffId = 0;
	rhs.texId = 0;

	return *this;
}



GLBufferId OGLHgGPUBuffer::getGLBufferId()
{'fraction_non_alphanumeric': 0.16474210931485758, 'fraction_numerical': 0.013856812933025405, 'mean_word_length': 5.63265306122449, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '647740', 'n_tokens_mistral': 589, 'n_tokens_neox': 563, 'n_words': 90}