Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty sf::String crash #389

Closed
TGlas opened this issue May 9, 2013 · 3 comments
Closed

empty sf::String crash #389

TGlas opened this issue May 9, 2013 · 3 comments

Comments

@TGlas
Copy link

TGlas commented May 9, 2013

The following program crashes during destruction of an empty sf::String:

#include <SFML/Window.hpp>
int main()
{
    sf::String s = "";     // (the    = ""     is optional)
}

Consequently, the same happens when creating a window with an empty title.
The error message is:

main(73755) malloc: *** error for object 0x10000d7e0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Changing the line to

    sf::String s = "non-empty";

makes the crash go away.

This bug started to appear in my code right after switching to SFML 2.0 stable
this afternoon (before I did not have an sf::String class). I am on MacOS 10.6.8
and I use either g++ or clang++ to compile the program from the command line,
e.g.:

clang++ -framework sfml-system -framework sfml-window -o main main.cpp
@mjbshaw
Copy link

mjbshaw commented May 9, 2013

See issue #5 and check if std::basic_string<unsigned int> s; crashes for you too.

@mantognini
Copy link
Member

Common guys, this is the third report this week.. don't you search before posting something ? ... anyway, as @mjbshaw said, this is #5.

@TGlas
Copy link
Author

TGlas commented May 9, 2013

On Thu, May 9, 2013 at 9:47 PM, Marco Antognini notifications@github.comwrote:

Common guys, this is the third report this week.. don't you search before
posting something ? ... anyway, as @mjbshaw https://github.com/mjbshawsaid, this is
#5 #5.

Sorry!
Sure, it is #5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants