By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,663 Members | 762 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,663 IT Pros & Developers. It's quick & easy.

On closing application ntdll.dll is crashed

P: 1
Hi all,

I am getting crash in ntdll.dll just after CDialog::OnOK(); function. It is not getting crashed everytime. Application is multithreaded, but it is after i have added new thread. In that I am using vector list and also maintaining the criticalsection and thread proc close event. Now, in constructor i m setting NULL to all handles and initialize critical section and for stopping thread i m setting close event and my thread is comeout for waitForMultipleObject and returning. I am not terminating thread/exitthread. As i have read in msdn not to do this in c++. need to first return from threadproc.

I am also delete critical section close all handles. Only thing i can think of is i am not clearing my vector list. Is that be a cause of crashing.

Also this class is derive class of a abstract class. So, that a pointer will be of a parent class.

Any guesses which i can tryout to solve this crash. As i have marked no distructor is called of my anyother class.

Please help me out.
Thank you.
Archita
Aug 10 '07 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
The vector couklkd well bwe th cause of the crash.

You say not destructors are called. Does that mean your derived class (wirth the vector) is not having the destructoir called?? Is that right??

Be sure the destructor in your base class is virtual. Unless it is, the destructor of your derived class will never be called.

Also, be careful of iterators. If the vector is altered by the thread, all the iteratros become invaloid and can't be trusted. You would need to re-initialize them each time beofre using and this would have to be done in the crtical section unless you are using a lock that is valid outside the critical section.
Aug 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.