Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Nerote

Pages: [1]
1
Graphics / Re: Problem with deleting sf::Font pointer
« on: January 05, 2013, 09:04:16 pm »
I followed the tutorial on this website when i recompiled it.
I set the CMAKE_BUILD_TYPE to Debug, rest as the default.
Generator set to Visual Studio 11.

2
Graphics / Re: Problem with deleting sf::Font pointer
« on: January 05, 2013, 08:46:07 pm »
This code does not work.

#include <SFML\Graphics.hpp>


int main()
{
        sf::Font* font = new sf::Font();
        delete font;

        return 0;
}
 

And im not mixing release and debug.

I just got some response from a friend who said as previous poster stated with putting them on the stack. So i guess i should avoid pointers with the fonts.

Although im a bit confused why i am not able to delete sf::Font's.


3
Graphics / Re: Problem with deleting sf::Font pointer
« on: January 05, 2013, 08:36:57 pm »
Yes I have recompiled SFML for this version.

4
Graphics / Re: Problem with deleting sf::Font pointer
« on: January 05, 2013, 08:32:19 pm »
I tried to allocate and delete in the main function.
I am using Visual Studio 2012 and it breaks when calling delete in "dbgheap.c"

extern "C" _CRTIMP int __cdecl _CrtIsValidHeapPointer(
        const void * pUserData
        )
{
        if (!pUserData)
            return FALSE;

        if (!_CrtIsValidPointer(pHdr(pUserData), sizeof(_CrtMemBlockHeader), FALSE))
            return FALSE;

        return HeapValidate( _crtheap, 0, pHdr(pUserData) );
}
 

Im having a hard time describing my problem any better.
Thanks.

5
Graphics / Problem with deleting sf::Font pointer
« on: January 05, 2013, 07:56:40 pm »
Hello, i ran into some trouble when playing around with the sf::Font class.

sf::Font* font = new sf::Font();

delete font;
 

This is not working, just wondering if there's something i've missed?

Thanks!

Pages: [1]
anything