Dynamic memory problem


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

Hey,

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

Did you know?Explore Trending and Topic pages for more stories like this.
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

check comment for html
hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it

Simultaneous select/update/insert
Hi

How would I need to go about when 2 users update a single row simultaneous? And how would

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

All possible combinations of String in PL/SQL
Hi All,

Could you please explain the logic of getting all possible combinations of String

Strip Slashes Help
I've got a script that i've downloaded of the net to edit multiple fields from my sql database, and

Needing Youtube thumb nail fix.
I have a script on a site that pulls in you-tube videos,
The problem is, that the thumb nails for

PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.

Thanks!

Why use OOP?
Can someone explain to me why I should use OOP instead of procedure based code.

Im building a

Breaking results into week blocks
I have a set of dates (and times), which are returned from a mySQL query.

These usually span

Local file browser with php
Halo..

So this is what i want to create. I have a folder that i share and it has many movies.

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