[ERROR] Invaid memory access. (read error at address 9908301)
The error occurs on the line with "Freememory" on it and usually does so on second time it's called.
I was wondering if since I'm reallocating memory inside a function on that pointer and that pointer has a different name inside the function that this is causing a problem...
Any other ideas what might cause this? I'm not sure where to look as I don't know what kinds of situations freememory would fail
Code: Select all
Procedure WorkWithMem(*Ptr)
*Ptr = ReAllocateMemory(*Ptr,10)
; do all sorts of things here with the memory but don't free it
EndProcedure
*Ptr1 = AllocateMemory(1)
WorkWithMem(*Ptr1)
FreeMemory(*Ptr1)
*Ptr1 = AllocateMemory(1)
WorkWithMem(*Ptr1)
FreeMemory(*Ptr1)


