Re: Access violation after nullifiying and again allocating pointer
But it appears if I replace the nullify with a deallocate, too.
So there might be other places where you produce memory leaks. Anybody
using pointers is likely to, at least initially, have some in their
program.
Get yourself a compiler supporting the ALLOCATABLE TR, and change the
pointers to allocatables everywhere you can (which should be a very large
fraction of the extant population). That should improve things considerably.
Jan
.
Relevant Pages
- Re: how DEALLOCATE statement works in f2003
... As there is no other pointer to those allocatables pointed ... deallocate anything allocatable _pointed_to_ by a pointer manually. ... way for you to create a memory leak with allocatables. ... The case involved also involved pointers, though, which I think is outside that dictum -- there is a memory leak, arising when an allocatable is deallocated, which happens because the allocatable contains pointers. ... (comp.lang.fortran) - Re: Derived type - valued function with pointer member.
... It was my understanding that pointers were needed to accomplish this. ... unless you embrace the common extension where ALLOCATABLES can be used. ... END TYPE mytype ... When I make the %vec's allocatable arrays instead, the program segfaults on calling vplus. ... (comp.lang.fortran) - Re: DO or FORALL control ... is not declared locally ?
... of pointers for which there is an allocatable array equivalent". ... Many current uses of pointer components are for ... things that would more naturally be allocatables. ... (comp.lang.fortran) - Re: how DEALLOCATE statement works in f2003
... contains pointers. ... Thus I stick by my claim that you cannot leak memory with allocatables. ... (comp.lang.fortran) - Re: iso_varying_string in f2003?
... to state it as a property of allocatables than as a property of ... everything other than pointers. ... It is a bug in the standard. ... That's not a memory leak. ... (comp.lang.fortran) |
|