Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Pointer Error

Author
Message
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 16th Mar 2010 05:13 Edited at: 16th Mar 2010 05:14


As soon as the first GameChat::Update ( ) is called the program crashes with a memory read error, this does not happen if I comment out //this->GameTextOut[0]->update ( ); from the Update function.

I'm not sure if i'm even using the pointers properly..I was planning on releasing this class on the forum though once it was complete as an addon to DarkForm, if someone was to help that would be awesome cause I can't figure this out for the life of me..

Add me to your MSN!
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 16th Mar 2010 06:14 Edited at: 16th Mar 2010 06:17
nm

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 16th Mar 2010 07:07


You're allocating those 2 classes on the stack, which means as soon as your function returns, their memory will be invalid, so you cannot store it in the pointer like this; you must dynamically allocate them.

kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 16th Mar 2010 08:24
Oh darn...ok thanks

Add me to your MSN!

Login to post a reply

Server time is: 2024-11-20 03:46:01
Your offset time is: 2024-11-20 03:46:01