SFML community forums
Help => Graphics => Topic started by: Groogy on January 19, 2009, 10:13:12 pm
-
It's probably me that has done something wrong. But every time I try to run my application with sf::String it crashes when it shuts down(working perfectly until then). When I uncomment the line where I create the object the error disappears.
Can't see what's wrong.
-
Since it crashes for me at the end too sometimes i tested it with sf::String and SFML.Graphics.String2D from SFML.net and both times the program crashes at then end once i have a variable of that type in it.
-
I don't know much of the internal functions of the library.
But I'm working at Windows at the moment, but it feels like I would get a SEGMENTATION FAULT if I would have done this in Linux. So my guess is that somewhere we tries to dealloc NULL or something.
-
It happens when the default font is destroyed (so it won't happen if it doesn't get instanciated).
I've already worked hard on this issue, and I have no clue so far :(
-
Your sure it's the font? Since It happens when the String is removed? I'll have a look at the source code and see If I can find anything.
Does this happen for everyone or is it isolated?
-
Hmm you don't have a destructor for either classes. Couldn't be that the default destructor is messing something up? Though I can't think of a reason why it would.
I'll put some cout here and there and see if I can narrow down the error.
-
Wierd thing, you said the default font did it? I told my sf::String object to use another font with: "text.SetFont(font);" but I still get the same thing.
Do I have to use the constructor to avoid the error?
-
Do I have to use the constructor to avoid the error?
Yes, because the constructor instanciates the default font in case you don't specify another one.