possible bug?
Posted: Tue Nov 28, 2006 06:24
I'm getting some extremely odd crashes with my CEGUI code.
Read the comments in what I post below
-----------------------------
bool DirectConnect(const CEGUI::EventArgs& args)
{
using namespace CEGUI;
WindowManager& winMgr = WindowManager::getSingleton();
CEGUI::String playStr, ipStr;
Editbox* ipBox = static_cast<Editbox*>(winMgr.getWindow("IPBox"));//THIS CODE WORKS
Editbox* nameBox = static_cast<Editbox*>(winMgr.getWindow("PlayerNameBox"));//THIS CODE WORKS
nameBox->setText("some text");//THIS CODE WORKS
ipBox->setText("some text"); //THIS CODE WORKS
ipStr = nameBox->getText();//THIS CODE CRASHES!
playStr = ipBox->getText();//THIS ALSO CRASHES!
return true;
};
--------------------------------------------
I'm at a loss here because my pointers are working (I can set text) but it crashes with an access violation when reading the data. Even stranger, I can run this just fine in debug mode, I only get the errors with release mode.
EDIT: There are no errors in the log file either...
Read the comments in what I post below
-----------------------------
bool DirectConnect(const CEGUI::EventArgs& args)
{
using namespace CEGUI;
WindowManager& winMgr = WindowManager::getSingleton();
CEGUI::String playStr, ipStr;
Editbox* ipBox = static_cast<Editbox*>(winMgr.getWindow("IPBox"));//THIS CODE WORKS
Editbox* nameBox = static_cast<Editbox*>(winMgr.getWindow("PlayerNameBox"));//THIS CODE WORKS
nameBox->setText("some text");//THIS CODE WORKS
ipBox->setText("some text"); //THIS CODE WORKS
ipStr = nameBox->getText();//THIS CODE CRASHES!
playStr = ipBox->getText();//THIS ALSO CRASHES!
return true;
};
--------------------------------------------
I'm at a loss here because my pointers are working (I can set text) but it crashes with an access violation when reading the data. Even stranger, I can run this just fine in debug mode, I only get the errors with release mode.
EDIT: There are no errors in the log file either...