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

Author Topic: sf::Text destructor crashes app  (Read 4997 times)

0 Members and 1 Guest are viewing this topic.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
sf::Text destructor crashes app
« 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.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Beliar

  • Newbie
  • *
  • Posts: 27
    • View Profile
sf::Text destructor crashes app
« Reply #1 on: January 19, 2009, 10:42:35 pm »
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.
Debuggers don't remove bugs. They only show them in slow motion.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
sf::Text destructor crashes app
« Reply #2 on: January 19, 2009, 10:45:25 pm »
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.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::Text destructor crashes app
« Reply #3 on: January 19, 2009, 10:48:04 pm »
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 :(
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
sf::Text destructor crashes app
« Reply #4 on: January 19, 2009, 10:52:50 pm »
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?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
sf::Text destructor crashes app
« Reply #5 on: January 19, 2009, 11:10:21 pm »
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.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
sf::Text destructor crashes app
« Reply #6 on: January 19, 2009, 11:42:00 pm »
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?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::Text destructor crashes app
« Reply #7 on: January 20, 2009, 07:52:45 am »
Quote
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.
Laurent Gomila - SFML developer