Hello, in my project, a variable needs to be allocated since its outside the 
scope of where it will be used.
The variable is a pointer type inside a record structure.
I initialize this pointer with GetMem(variable, sizeof(pointer))
However, when it's passed into a function, a new pointer is assigned to it. If 
I call FreeMem it raises a Invalid pointer operation exception. So What I'm 
wondering, is there a memory leak using GetMem if I dont use FreeMem since the 
variable get reassigned?

An example of scope I'm talking about here, I have a procedure to initialize a 
veriable pointing to the structure. In another procedure the variable structure 
with the pointer I'm refering to gets reassigned. I just want to know what 
happend to the initial memory that was assigned to it.
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to