SFML community forums

Help => Window => Topic started by: transient on August 21, 2009, 08:14:37 pm

Title: Window title / window creation, deletion
Post by: transient on August 21, 2009, 08:14:37 pm
I have a few quick questions about windows:

I'm creating a window as such.
Code: [Select]

// Create the window settings
sf::WindowSettings settings;
settings.DepthBits = 32;
settings.StencilBits = 8;
settings.AntialiasingLevel = 2;

// Create the window
sf::Window* window = (new sf::Window(sf::VideoMode(dim.x, dim.y, 32), "abc", sf::Style::Close | sf::Style::Titlebar | sf::Style::Resize, settings));


Now, the title of the window ends up being something like this "LLLLabc" (a weird ascii L though.)

Also, when I call

Code: [Select]

delete window;


I get a memory error.

Any ideas why?  Thanks
Title: Re: Window title / window creation, deletion
Post by: Hiura on August 22, 2009, 12:32:48 am
Quote from: "transient"
I have a few quick questions about windows:

I'm creating a window as such.
Code: [Select]

// Create the window settings
sf::WindowSettings settings;
settings.DepthBits = 32;
settings.StencilBits = 8;
settings.AntialiasingLevel = 2;

// Create the window
sf::Window* window = (new sf::Window(sf::VideoMode(dim.x, dim.y, 32), "abc", sf::Style::Close | sf::Style::Titlebar | sf::Style::Resize, settings));


Now, the title of the window ends up being something like this "LLLLabc" (a weird ascii L though.)


 :arrow: http://www.sfml-dev.org/forum/viewtopic.php?t=1257&highlight=title

Quote from: "transient"
Also, when I call

Code: [Select]

delete window;


I get a memory error.

Any ideas why?  Thanks
Because you delete your window in the wrong way : I mean you use it afterwards.
But with a minimal code that reproduce the error we could say more than an hypothetical cause.
Title: Window title / window creation, deletion
Post by: transient on August 22, 2009, 07:08:20 am
Linking to release libraries while compiling in debug mode isn't always the smartest idea...

Thanks.

(Also, I was not using the window after I deleted it, but that is of minimal consequence now.  Also, I thought I gave just enough code to reproduce the issue.  To each their own.)