Re: [Gambas-user] Tests against pointers in Gambas3

2011-01-14 Thread Demosthenes Koptsis
hello again list, i am finishing the chapter of pointers soon. Something last about them. In C++ books it is suggested after the usage of a pointer to free it and then assign value 0. Do you think this advice could be done to Gambas3 like this for safe programming? Close #hMemory

Re: [Gambas-user] Tests against pointers in Gambas3

2011-01-14 Thread Jussi Lahtinen
I'm not sure how much this has significance in Basic, but it is good habit. And maybe it should be done internally in Free()..? Jussi On Fri, Jan 14, 2011 at 13:42, Demosthenes Koptsis demosthen...@gmail.comwrote: hello again list, i am finishing the chapter of pointers soon. Something

Re: [Gambas-user] Tests against pointers in Gambas3

2011-01-14 Thread Demosthenes Koptsis
as i saw in C++ Free returns the allocated memory back to free memory. That's all. Free() do not do anything with the variable pPointer. That's why pointers keep their addresses and leads to misusage at next lines of code. Although i find it good idea. On Fri, 2011-01-14 at 19:35 +0200, Jussi

Re: [Gambas-user] Tests against pointers in Gambas3

2011-01-14 Thread BenoƮt Minisini
Hi, i study the cases of pointers and i found at this page http://www.yolinux.com/TUTORIALS/C++MemoryCorruptionAndMemoryLeaks.html cases of program crashes from bad usage of pointers. i made a test for Attempting to write to memory already freed. --- '

Re: [Gambas-user] Tests against pointers in Gambas3

2011-01-12 Thread tobias
hi, Hi, i study the cases of pointers and i found at this page http://www.yolinux.com/TUTORIALS/C++MemoryCorruptionAndMemoryLeaks.html cases of program crashes from bad usage of pointers. i made a test for Attempting to write to memory already freed. ... in this example i free

[Gambas-user] Tests against pointers in Gambas3

2011-01-11 Thread Demosthenes Koptsis
Hi, i study the cases of pointers and i found at this page http://www.yolinux.com/TUTORIALS/C++MemoryCorruptionAndMemoryLeaks.html cases of program crashes from bad usage of pointers. i made a test for Attempting to write to memory already freed. --- ' Gambas module

Re: [Gambas-user] Tests against pointers in Gambas3

2011-01-11 Thread Jussi Lahtinen
Seems that Gambas still owns that address, but it is not protected anymore and so it can be used to other purposes. I'm not sure when Gambas *actually* frees that address. There are fundamental problems when you compare C/C++ and any basic language in this way. Same line in C may mean very