Deleting objects from a vector

i've written a program in which i make several objects and place them in a vector. At some point during the program, i call a function that eventually deletes the object in the vector like this:

myVector[counter]->method();
delete myVector[counter];
(i've also tried putting myVector.erase(myVector.begin()+counter); after it )

However, when i attempt to access information from this object after the deletion, it still allows me to do so, leading me to believe that the object is not gone after all.
What can i do to fix this?
Just because you delete it doesn't mean the memory hasn't been given to someone else yet. It just happened that the memory wasn't changed between you deleting it and accessing it again. You shouldn't be accessing it after you've deleted it anyway.
Topic archived. No new replies allowed.