--
[ Picked text/plain from multipart/alternative ]
Windows cleans up after an application that leaks memory, but yea you don't
want to purposely leave memory leaks. I'd venture a guess that it's not the
vector thats causing the crash but something else. Memory corruption, double
deletion, etc. If you are deleting and then calling a function where it
tries to delete again it will crash, and vice versa. I would treat it like
an std::vector, just remove the elements and do the deletions yourself.

On Jan 11, 2008 10:42 AM, Jamie Femia <[EMAIL PROTECTED]> wrote:

> --
> [ Picked text/plain from multipart/alternative ]
> That's what I'd like to know.. I'm not totally convinced that it's safe to
> just leave stuff in the memory.. perhaps a member of Valve staff can
> confirm?
>
> On Jan 11, 2008 6:28 PM, Minh <[EMAIL PROTECTED]> wrote:
>
> > --
> > [ Picked text/plain from multipart/alternative ]
> > hmm.. I've gotten way with just calling
> > RemoveAll()  on my CUTLVectors.
> > Then when I add new elements, I believe it just overtakes the existing
> > memory addresses of these previous elements that were in the vector.
> Mind
> > you, my utlvectors typically never grow to be more than 20 elements.
> >
> > When Half-Life2 shuts down, does all of the memory allocations that were
> > created during the game get deallocated automatically, so other programs
> > can
> > use them?
> >
> >
> > ----- Original Message -----
> > From: "Jamie Femia" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Friday, January 11, 2008 9:55 AM
> > Subject: Re: [hlcoders] CUtlVector<*>... Memory management?
> >
> >
> > > --
> > > [ Picked text/plain from multipart/alternative ]
> > > Then why is it that when I try and delete the elements it crashes the
> > > game?
> > > lol...
> > >
> > > On Jan 11, 2008 5:37 PM, Tony omega Sergi <[EMAIL PROTECTED]> wrote:
> > >
> > >> --
> > >> [ Picked text/plain from multipart/alternative ]
> > >> you have to delete what you add. purging just removes the elements.
> > >>
> > >> On Jan 11, 2008 11:35 AM, Jamie Femia <[EMAIL PROTECTED]> wrote:
> > >>
> > >> > --
> > >> > [ Picked text/plain from multipart/alternative ]
> > >> > Am I right in assuming that if you have a vector of pointers, that
> > >> > point
> > >> > to
> > >> > things you create with "new", you have to either call delete on
> each
> > >> > element
> > >> > or use PurgeAndDeleteElements()? Because that's what I've been
> using
> > up
> > >> > until recently, where it seems that trying to delete elements from
> a
> > >> > pointer
> > >> > vector on destruction of whatever they are members of just causes
> the
> > >> game
> > >> > to crash with a memory error. Removing the calls to delete stop the
> > >> crash,
> > >> > but unless CUtlVector automatically cleans up your memory for you,
> > >> > won't
> > >> > this just create MASSIVE memory leaks?  As far as I knew,
> CUtlVector
> > >> > didn't
> > >> > magically look after your memory for you... was I wrong?
> > >> >
> > >> > J
> > >> > --
> > >> >
> > >> > _______________________________________________
> > >> > To unsubscribe, edit your list preferences, or view the list
> > archives,
> > >> > please visit:
> > >> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> -omega
> > >> --
> > >>
> > >> _______________________________________________
> > >> To unsubscribe, edit your list preferences, or view the list
> archives,
> > >> please visit:
> > >> http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > >>
> > >>
> > > --
> > >
> > > _______________________________________________
> > > To unsubscribe, edit your list preferences, or view the list archives,
> > > please visit:
> > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > >
> >
> > --
> >
> > _______________________________________________
> > To unsubscribe, edit your list preferences, or view the list archives,
> > please visit:
> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> >
> >
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to