<commit_before>#include "MenuState.h"
#include "MenuButton.h"
#include "Game.h"

MenuState::MenuState()
{
}

bool MenuState::init()
{
    m_stateName = "MENU";
    Log::Info("Entering Menustate...");
    TextureManager::instance().loadTexture("play", "assets/textures/button.png");
    TextureManager::instance().loadTexture("exit", "assets/textures/exit.png");
    m_objects.push_back(new MenuButton(100, 100, 400, 100, "play", menuToGame));
    m_objects.push_back(new MenuButton(100, 300, 400, 100, "exit", menuToQuit));
    return true;
}

void MenuState::run()
{
    State::run();
}

void MenuState::render()
{
    State::render();
}

void MenuState::update()
{
    State::update();
}

void MenuState::exit()
{
    TextureManager::instance().deleteTexture("play");
    TextureManager::instance().deleteTexture("exit");
    Log::Info("Exiting Menustate...");
}

void MenuState::handleEvents()
{
    State::handleEvents();
}

void MenuState::menuToGame()
{
    Log::Info("Menu to Game clicked");
    StateMachine::instance().pop();
    StateMachine::instance().push(new Game());
}

void MenuState::menuToQuit()
{
    Log::Info("Menu to Quit clicked");
    StateMachine::instance().pop();
    StateMachine::instance().quitGame();
}<commit_msg>Fix memory leak<commit_after>#include "MenuState.h"
#include "MenuButton.h"
#include "Game.h"

MenuState::MenuState()
{
}

bool MenuState::init()
{
    m_stateName = "MENU";
    Log::Info("Entering Menustate...");
    TextureManager::instance().loadTexture("play", "assets/textures/button.png");
    TextureManager::instance().loadTexture("exit", "assets/textures/exit.png");
    m_objects.push_back(new MenuButton(100, 100, 400, 100, "play", menuToGame));
    m_objects.push_back(new MenuButton(100, 300, 400, 100, "exit", menuToQuit));
    return true;
}

void MenuState::run()
{
    State::run();
}

void MenuState::render()
{
    State::render();
}

void MenuState::update()
{
    State::update();
}

void MenuState::exit()
{
    TextureManager::instance().deleteTexture("play");
    TextureManager::instance().deleteTexture("exit");
    Log::Info("Exiting Menustate...");
}

void MenuState::handleEvents()
{
    State::handleEvents();
}

void MenuState::menuToGame()
{
    Log::Info("Menu to Game clicked");
    StateMachine::instance().push(new Game());
}

void MenuState::menuToQuit()
{
    Log::Info("Menu to Quit clicked");
    StateMachine::instance().pop();
    StateMachine::instance().quitGame();
}
{'fraction_non_alphanumeric': 0.19218241042345277, 'fraction_numerical': 0.019543973941368076, 'mean_word_length': 5.188916876574307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7012358', 'n_tokens_mistral': 858, 'n_tokens_neox': 800, 'n_words': 137}