<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace GameEngine.Drawing
{
    /// <summary>
    /// Class that provides static extension methods for drawing Geometrical shapes on the Display
    /// </summary>
    public static class Shapes
    {
        public static void DrawRectangle(this SpriteBatch SpriteBatch, Rectangle DestRectangle, Color Background)
        {
            Texture2D rectText = new Texture2D(SpriteBatch.GraphicsDevice, 1, 1);
            rectText.SetData<Color>(new Color[] { Background });

            SpriteBatch.Draw(rectText, DestRectangle, Color.White);
        }
    }
}<commit_msg>Fixed Memory Leak<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace GameEngine.Drawing
{
    /// <summary>
    /// Class that provides static extension methods for drawing Geometrical shapes on the Display
    /// </summary>
    public static class Shapes
    {
        private static Texture2D rectText;

        public static void DrawRectangle(this SpriteBatch SpriteBatch, Rectangle DestRectangle, Color Background)
        {
            if( rectText == null )
                rectText = new Texture2D(SpriteBatch.GraphicsDevice, 1, 1);

            rectText.SetData<Color>(new Color[] { Background });

            SpriteBatch.Draw(rectText, DestRectangle, Color.White);
        }
    }
}
{'fraction_non_alphanumeric': 0.08969465648854962, 'fraction_numerical': 0.005089058524173028, 'mean_word_length': 3.043701799485861, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7291887', 'n_tokens_mistral': 425, 'n_tokens_neox': 417, 'n_words': 118}