EventListener

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
charl3s7
Posts: 11
Joined: Sat Oct 03, 2009 3:17 am

EventListener

Post by charl3s7 »

When I insert create an EventListener, I get random memory errors all over the place. It only makes an error when I initialize the class. Help? :/
//Charles
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: EventListener

Post by randomMesh »

charl3s7 wrote:Help?
Code?
"Whoops..."
charl3s7
Posts: 11
Joined: Sat Oct 03, 2009 3:17 am

Post by charl3s7 »

I was only testing the event receiver

EventReceiver:

Code: Select all

class EventReceiver : public IEventReceiver
{
	virtual bool OnEvent(const SEvent & event)
	{
		return false;
	}
};
And it would crash in absolutely random spots.

Once here:

Code: Select all

IrrXMLReader * Xml = createIrrXMLReader("main.xml");
while(Xml->read())
{
//read xml
}
Then I commented it out and tried again.

Broke here:

Code: Select all

ITexture * Sky = Driver->getTexture("Sky.png");
//Charles
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

You probably deleted some object....
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
charl3s7
Posts: 11
Joined: Sat Oct 03, 2009 3:17 am

Post by charl3s7 »

No, I didn't delete anything. Once I instance the class, it breaks.
//Charles
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Please post a complete example which we can compile, otherwise we don't really see what's going wrong. Your EventReceiver class is likely not the problem (my guess would be you instantiate it within some scope which is no longer valid when the receiver object is needed).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, and the logger output, which goes through the event receiver, is causing random crashes at file access and debug output.
Post Reply