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
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:
:)
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
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
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
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
OK, I managed to isolate this problem!
This will crash Gambas 3 rev 3452 @ Ubuntu 10.10 64bit.
Public Sub Form_Open()
Dim hFile As File
Dim sho As Short
Dim sStr As String = 'abc Crash only occurs if string is null.
hFile = Open /tmp/test For Create
Write #hFile, 123 As Short
Write
i'm have problems displaying tool button on a toolbar the bottom of the
button is all ways cut off
using gambas 3 build 3452
Can you provide a project that shows the problem? Or at least details about
your system and a screenshot?
Regards,
--
Benoît Minisini
Hi, It seems to be possible to add a picture to menu, but it works only
with sub-menu.The top-menu shows no picture. Gambas2 Rev. 3439Ubuntu
10.04GTK+
RegardsIvan
It seems but not. Parent menus can have a picture with gb.qt4, but not with
gb.gtk. I will check if it is a GTK+
Hi Benoit,
I've mentioned this before and got no response, though I know how busy you
are, its not critical as I can edit the form definition and fix it.
I sometimes forget some reports, so do repeat it if you do not see any answer
after three or four weeks!
In some situations, (if one
Hello,
i do not understand the MkXXX$() functions.
How to use them and where?
i tried to print the return of them but i did not understand the
representation of memory as string.
Print MkBool$(True)
gives
^A
They are doing the same thing as the WRITE instruction from a memory
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.
---
'
12 matches
Mail list logo