C # / XNA Гигантская утечка памяти

Error: User Rate Limit Exceeded

Ответы на вопрос(2)

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

spriteBatch.DrawString(font, "Score: " + score, location, Color.Black);
spriteBatch.DrawString(font, "Something else: " + foo, overHere, Color.Black);
spriteBatch.DrawString(font, "And also: " + bar, overThere, Color.Black);

Error: User Rate Limit ExceededstringError: User Rate Limit ExceededStringBuilderError: User Rate Limit ExceededDrawError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceededdon't really matterError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

How do we fix this?

Error: User Rate Limit ExceededDrawStringError: User Rate Limit ExceededStringBuilderError: User Rate Limit ExceededstringError: User Rate Limit ExceededStringBuilderError: User Rate Limit Exceeded

Error: User Rate Limit ExceededToString()Error: User Rate Limit ExceededStringBuilderError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

public static class StringBuilderExtensions
{
    // 11 characters will fit -4294967296
    static char[] numberBuffer = new char[11];

    /// <summary>Append an integer without generating any garbage.</summary>
    public static StringBuilder AppendNumber(this StringBuilder sb, Int32 number)
    {
        bool negative = (number < 0);
        if(negative)
            number = -number;

        int i = numberBuffer.Length;
        do
        {
            numberBuffer[--i] = (char)('0' + (number % 10));
            number /= 10;
        }
        while(number > 0);

        if(negative)
            numberBuffer[--i] = '-';

        sb.Append(numberBuffer, i, numberBuffer.Length - i);

        return sb;
    }
}

Error: User Rate Limit ExceededveryError: User Rate Limit ExceededabsolutelyError: User Rate Limit ExceededstringError: User Rate Limit Exceeded

Error: User Rate Limit ExceededGC.Collect().

Ваш ответ на вопрос