Dynamic memory problem


Posted on 16th Feb 2014 07:03 pm by admin

Hey,

At the beginning of my code, I have this line:

Shape* gShape = 0;

As this is dynamic memory, I delete it at the end:
delete gShape;
gShape = 0;

This compiles fine and runs fine, but as soon as I close the program, I get a "not working anymore" window from the OS (you know which I mean; "send this to microsoft bleeeeh"). It only crashes this way when I actually use the Shape instance, so when I use gShape = new class(parameters);. If I don't use the instance (I keep it 0), it doesn't crash.

What am I doing wrong?

Thank you!

No comments posted yet

Your Answer:

Login to answer
329 Like 31 Dislike
Previous forums Next forums
Other forums

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

utl_file open error
i have file in the unix path

Path /popdev01/pop/popdevb/tfi/

File name

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just

How to validate from 2 possible answers
Hi

I hope somebody can help me with what will probably be really simple, I'm pulling my hair

Display the user's weight lost in the past week
Hello everyone,

I am working on a weight loss app for my site, and I want to display the user

Mail form doesn't send Russian/Cyrillic characters correctly?
When someone enters foreign characters (like Cyrillic text, and Japanese/Chinese probably gives the

Count of reciepients in php mailer
How can i sent a mail to large no of reciepients say 10,00,00 Using PHP MAILER

weird problem
last time, i did post a topic concerning why my page sometime will load as blank page when using IE.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash