Re: [Gambas-user] Crash with Free()

2011-01-16 Thread Bruce Bruen
On Friday, January 14, 2011 05:07:45 am Jussi Lahtinen wrote: Hi! I was adding some test for pointer arithmetic when noticing this. GambasTester will pass, but when you close main form, signal 11 will rise. Commenting out Free(pp) from mTest: line 1070, will prevent crash. Gambas 3 rev 3452

Re: [Gambas-user] Crash with Free()

2011-01-14 Thread Jussi Lahtinen
True, and that is my only usage for them, except GambasTester which is supposed to test every command for possible errors. Jussi On Fri, Jan 14, 2011 at 05:29, Ian Haywood ihayw...@iinet.net.au wrote: On Fri, Jan 14, 2011 at 8:41 AM, Demosthenes Koptsis demosthen...@gmail.com wrote: :)

Re: [Gambas-user] Crash with Free()

2011-01-14 Thread Jussi Lahtinen
Aaaa... of course, pointer is not correct to free after pp += 4. Though, result shouldn't be signal 11. It could not be different. I mean Gambas should handle this without crash, but of course this is anyhow end of execution. I still would like to see error message with according line

Re: [Gambas-user] Crash with Free()

2011-01-14 Thread Demosthenes Koptsis
Jussi i can post here the cases of pointer's mis-usage from my book and you can add any of them in your project freely. 1) Assign new address to an existing pointer drives to memory leak. The first address cannot be freed directly. ' Gambas module file Public Sub Main() Dim pPointer1 As

[Gambas-user] Crash with Free()

2011-01-13 Thread Jussi Lahtinen
Hi! I was adding some test for pointer arithmetic when noticing this. GambasTester will pass, but when you close main form, signal 11 will rise. Commenting out Free(pp) from mTest: line 1070, will prevent crash. Gambas 3 rev 3452 @ Ubuntu 10.10 64bit Jussi GambasTester-0.9.18.tar.gz

Re: [Gambas-user] Crash with Free()

2011-01-13 Thread Benoît Minisini
Hi! I was adding some test for pointer arithmetic when noticing this. GambasTester will pass, but when you close main form, signal 11 will rise. Commenting out Free(pp) from mTest: line 1070, will prevent crash. Gambas 3 rev 3452 @ Ubuntu 10.10 64bit Jussi You are calling Free(pp)

Re: [Gambas-user] Crash with Free()

2011-01-13 Thread Jussi Lahtinen
Aaaa... of course, pointer is not correct to free after pp += 4. Though, result shouldn't be signal 11. Jussi 2011/1/13 Benoît Minisini gam...@users.sourceforge.net Hi! I was adding some test for pointer arithmetic when noticing this. GambasTester will pass, but when you close main form,

Re: [Gambas-user] Crash with Free()

2011-01-13 Thread Demosthenes Koptsis
:) Pointers are tricky! And may be this subject is difficult for BASIC programmers like me. But in time we can learn their tricks and pay attention to such cases. In my book i simulate and describe such cases based on http://www.yolinux.com/TUTORIALS/C++MemoryCorruptionAndMemoryLeaks.html i do

Re: [Gambas-user] Crash with Free()

2011-01-13 Thread Ian Haywood
On Fri, Jan 14, 2011 at 8:41 AM, Demosthenes Koptsis demosthen...@gmail.com wrote: :) Pointers are tricky! yes, the ability to avoid pointers is one of the main advantages of higher-level languages like Gambas. I'm curious to know why you guys are so fascinated by them, other than interfacing

Re: [Gambas-user] Crash with Free()

2011-01-13 Thread Doriano Blengino
Ian Haywood ha scritto: On Fri, Jan 14, 2011 at 8:41 AM, Demosthenes Koptsis demosthen...@gmail.com wrote: :) Pointers are tricky! Aaaa... of course, pointer is not correct to free after pp += 4. Though, result shouldn't be signal 11. It could not be different. yes, the

Re: [Gambas-user] Crash with Free()

2011-01-13 Thread Demosthenes Koptsis
On Fri, 2011-01-14 at 14:29 +1100, Ian Haywood wrote: I'm curious to know why you guys are so fascinated by them Ian For me i just want to describe them for my book about Gambas3, that's all. In this, is including the tricky part of pointers and the correct use of them inside a program. --