error?

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
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

error?

Post by Spartacus »

whenever i close my window it crashes and im running on winxp

i found that it crashes at this point
within the file of IUnknown.h

bool drop()
{
--ReferenceCounter; // <-- this line specifcially
if (!ReferenceCounter)
{
delete this;
return true;
}

return false;
}
im not sure why :/ but it would be nice if it could be fixed :P
November235
Posts: 15
Joined: Thu Dec 04, 2003 11:09 am
Location: London UK
Contact:

Post by November235 »

I thought you weren't allowed to drop() things derived from IUnknown. I'm not sure about that, but I think that's the problem.
November235 - Are you in FINAL DENIAL?
Land - Air - Sea
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

Post by Spartacus »

Ok, I will try and find out what the problem is then, maybe I am dropping somthing I shouldn't be :/
FleshCrawler
Posts: 108
Joined: Fri Aug 22, 2003 1:04 pm
Location: Kerkrade, Netherlands
Contact:

Post by FleshCrawler »

is this when you are using the ESC-key to close your application?
I've been absent for really long, but i'm ready to reign my terror on you once again, mwuahahahahaha
Isometric God
Posts: 69
Joined: Sun Oct 12, 2003 3:42 pm
Location: Germany

Post by Isometric God »

It seems to be that "this" is NULL in this case. I have never heard that subtracting a value from an int. could cause a crash. What you did is probably Window->drop(); and with m_Window being NULL you call
drop() on an non-existing instance thus causing the crash.

I assume the window has been dropped before and is now NULL. You could test Window for NULL and find out. You could call any member function now and the result ( = crash ) would be the same... hope that helps
Post Reply