Re: stupid segfaults -- argh!



On 6/7/06, Jonathon Jongsma <jonathon jongsma gmail com> wrote:
On 6/7/06, Joe Van Dyk <joevandyk gmail com> wrote:
>
> Seems to me that when Program::initialize() exits, the global pointer
> variable would be pointing to garbage.
>
> Joe
>

why?  dynamically allocated objects live until you explicitly delete
them.  That's the essence of memory leaks, but it works to your
advantage in cases like this.  It's the same reason that your gui
variable isn't pointing at garbage when initialize() exits.

Whoops, you're right.  I was thinking automatic, not dynamic.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]