[SOLVED] GOOD READ -> problems with string arrays in obje

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

[SOLVED] GOOD READ -> problems with string arrays in obje

Post by Abraxas) »

I was wondering if anyone could let me in on some info that may help me solve my problem.

When I break out of my main subroutine, I call:

Code: Select all

device->closeDevice();
device->drop();
If I put a cout after the device->drop() it will immediately display on the console.

But for some reason, after that display the program waits about 10 seconds before exiting. Sometimes it will flood the console with Direct3d9 present failed (but not always, usually only when I click the X (close) windows button).

If I X the console when it's frozen, visual studio lets me know that:

exited with code -1073741510. If I wait about 15 seconds, it exits with code 0.

could thousands-size arrays (single dimension) if irrlicht classes be the problem? could passing the irrlicht pointers by arguments possibly be an issue?

Thanks.
Last edited by Abraxas) on Thu Nov 05, 2009 4:08 pm, edited 1 time in total.
Lambda
Posts: 126
Joined: Wed Feb 27, 2008 3:00 pm
Location: Spain, Huelva
Contact:

Post by Lambda »

try with

Code: Select all

device->closeDevice();
device->run();
device->drop();
Image
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Post by Abraxas) »

I managed to find the problem.

In a class I was using the type stringw in an array. when I comment out all references to that array the device closes fine.

any ideas on why this is happening? is it a bug?

EDIT: I replaced the stringw array in the object with a std::string from <string>. Console no longer hangs.
asparagusx
Posts: 81
Joined: Thu Oct 16, 2008 6:50 am

Post by asparagusx »

Are you not allocating a huge amount of memory and then not freeing it? I have had problem when exiting (e.g. it takes a while), when I did not de-allocate memory properly.

Asp
Post Reply