Re: [fpc-pascal] Disposing pointers and memory leaks

2009-03-29 Thread Joseph Montanez
Paul, No wonder i had memory that kept growning. Thank you soo much! On Sun, Mar 29, 2009 at 2:14 AM, Paul Ishenin wrote: > Joseph Montanez wrote: >> >>      New(Cursor); >> > > You allocated memory for Cursor >> >>      Cursor := DrawPixel(Screen, X, Y, 253, 253, 253); >> > > You assigned somet

Re: [fpc-pascal] Disposing pointers and memory leaks

2009-03-29 Thread Paul Ishenin
Joseph Montanez wrote: New(Cursor); You allocated memory for Cursor Cursor := DrawPixel(Screen, X, Y, 253, 253, 253); You assigned something to Cursor. Thus it is not pointed anymore to your previously allocated memory. Dispose(Cursor); You are trying to deallocate

[fpc-pascal] Disposing pointers and memory leaks

2009-03-29 Thread Joseph Montanez
Im struggling to get into memory management and im having issues. New(Cursor); WriteLn('New Cursor'); Cursor := DrawPixel(Screen, X, Y, 253, 253, 253); WriteLn('Assign Cursor'); SDL_Flip(Screen); WriteLn('Render Cursor'); {It dies here were did cursor go?}