[Lazarus] Memory leak in dbgrids?

2013-05-10 Thread Luca Olivetti
Hello,

I'm migrating some programs from lazarus 0.9.30 to lazarus 1.0.8 (well,
actually updating and recompiling, there's no need to migrate anything).
Heaptrc is showing some memory leaks in dbgrid, though it doesn't
pinpoint the line exactly.
I think the leak is due to the change of type from TBookarkStr to
TBookmark, and dbgrids calls GetBookmark but never calls FreeBookmark
(it either discards the bookmark in local functions or assigns nil to it).
I'll try calling FreeBookmark and see if the leak goes away.

Bye
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Memory leak in dbgrids?

2013-05-10 Thread Luca Olivetti
Al 10/05/13 09:36, En/na Luca Olivetti ha escrit:
 Al 10/05/13 09:13, En/na Luca Olivetti ha escrit:
 Hello,

 I'm migrating some programs from lazarus 0.9.30 to lazarus 1.0.8 (well,
 actually updating and recompiling, there's no need to migrate anything).
 Heaptrc is showing some memory leaks in dbgrid, though it doesn't
 pinpoint the line exactly.
 I think the leak is due to the change of type from TBookarkStr to
 TBookmark, and dbgrids calls GetBookmark but never calls FreeBookmark
 (it either discards the bookmark in local functions or assigns nil to it).
 I'll try calling FreeBookmark and see if the leak goes away.
 
 Mmh, actually it does, because FKeyBoomark is assigned nil only after
 clearing the list of selected records.
 Maybe the problem comes from the version of zeos in case it returns a
 different pointer for the same record?

Now I made a test project using SQLdb instead of zeos and the leak is
still there.
It happens with multiselect, each new selection increases the non-freed
block count.

Bye
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Regressions in GTK2 interface ?

2013-05-10 Thread dev . dliw
Hi,
had the same problem with missing icons with GTK some time ago, I think I 
resolved the issue with

update-mime-database ~/.local/share/mime

but I can't remember exactly...

d.l.i.w



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] OpenGL with Lazarus

2013-05-10 Thread Tommi Prami

Hello,

Is there any abstraction of OpenGL for Lazarus/FPC. I am not that 
interested on learning OpenGL at low level, but rather use what it can 
provide, a bit higher level?


Similar to GlScene... (Or is there Port of GlScene for Lazarus(FPC)...
)

-Tee-

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] OpenGL with Lazarus

2013-05-10 Thread Mattias Gaertner
On Fri, 10 May 2013 11:47:54 +0300
Tommi Prami tommi.pr...@gmail.com wrote:

 Hello,
 
 Is there any abstraction of OpenGL for Lazarus/FPC. I am not that 
 interested on learning OpenGL at low level, but rather use what it can 
 provide, a bit higher level?
 
 Similar to GlScene... (Or is there Port of GlScene for Lazarus(FPC)...
 )

See here
http://lmgtfy.com/?q=glscene+lazarus

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Memory leak in dbgrids?

2013-05-10 Thread Luca Olivetti
Al 10/05/13 10:08, En/na Luca Olivetti ha escrit:

 Now I made a test project using SQLdb instead of zeos and the leak is
 still there.
 It happens with multiselect, each new selection increases the non-freed
 block count.

patch with (partial) solution

http://bugs.freepascal.org/view.php?id=24412


-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es
Tel. +34 935883004  Fax +34 935883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Regressions in GTK2 interface ?

2013-05-10 Thread Juha Manninen
I have KDE here. I found a setting for GTK applications in KDE control
center but unfortunately it made no difference.
I am also getting hundreds of messages like this:

(lazarus:9608): Gdk-WARNING **: Attempt to draw a drawable with depth
24 to a drawable with depth 32

I guess it is related to the problem.


On 5/10/13, dev.d...@gmail.com dev.d...@gmail.com wrote:
 update-mime-database ~/.local/share/mime

The syntax was right but it made no difference either.

Anyway this is not a big problem. I mostly use QT bindings myself and
it works well.
It is enough to know that the problem is in my machine configuration
and not a bug in GTK2 bindings.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Regressions in GTK2 interface ?

2013-05-10 Thread Mark Morgan Lloyd

Juha Manninen wrote:

I have KDE here. I found a setting for GTK applications in KDE control
center but unfortunately it made no difference.



On 5/10/13, dev.d...@gmail.com dev.d...@gmail.com wrote:

update-mime-database ~/.local/share/mime


The syntax was right but it made no difference either.

Anyway this is not a big problem. I mostly use QT bindings myself and
it works well.
It is enough to know that the problem is in my machine configuration
and not a bug in GTK2 bindings.


I've got a main menu with some LEDs on it as icons, x86 Debian 6 
Squeeze KDE, LCL 1.1 R39139. Don't think I had to do anything 
outrageous to get it working on GTK2, but (from memory) it doesn't work 
on Qt.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] GDB 7.6 Issues

2013-05-10 Thread Torsten Bonde Christiansen

Hi List.

After the latest update of my Arch Linux i got a hold of GDB 7.6 and for 
some apparent reason
debugging from within lazarus has stopped working as it should. At least 
there is a problem

with breakpoints, since they are not always followed.

If i downgrade my GDB to 7.5.1 again debugging starts working again. 
Have anyone else experienced

this?

Ps. i'm using Lazarus of trunk (rev. 41103) and fpc 2.6.2

Kind regards,
Torsten B. Christiansen.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] GDB 7.6 Issues

2013-05-10 Thread Martin

On 10/05/2013 13:49, Torsten Bonde Christiansen wrote:

Hi List.

After the latest update of my Arch Linux i got a hold of GDB 7.6 and 
for some apparent reason
debugging from within lazarus has stopped working as it should. At 
least there is a problem

with breakpoints, since they are not always followed.

If i downgrade my GDB to 7.5.1 again debugging starts working again. 
Have anyone else experienced

this?

Ps. i'm using Lazarus of trunk (rev. 41103) and fpc 2.6.2


There is a known issue (in GDB) that leads to crashes when variables are 
inspected (via hint/watch or otherwise)

http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Issues_with_GDB_7.5.9_or_7.6

There is another issue, if your GDB is translated (none English), see 
same wiki page.


An issue with breakpoints is not yet known.
You can produce a log (see bottom of that wiki page). But given the 
watches bug, even if an issue with breakpoints can be found and maybe 
fixed, it will not help much.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Layered TFPImage

2013-05-10 Thread Leonardo M . Ramé
Hi, I need to create two or three TFPMemoryImages as a kind of layers,
then flatten all layers into another TFPImage.

I can copy one image onto another, by copying its pixels, but this way
the background image is covered by the upper image, because its
background is not transparent.

What I need is a way to copy one image WITH TRANSPARENT BACKGROUND onto
another.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] android: debugln and thread

2013-05-10 Thread Marc Weustink

Sven Barth wrote:

On 09.05.2013 15:00, Benito van der Zander wrote:


I don't know for sure what the cause could be, but: do you use FPC
2.5.1 or 2.7.1?

2.7.1


Thanks.


  Try using
__android_log_write directly instead of DebugLn to be 100% sure.


Surprisingly that one works fine...


Then it is at least no problem of the android port :)

Perhaps there is some problem on the way from DebugLn to
TCDWidgetSet.AndroidDebugLn...


If you don't use a widgetset, then you cannot use widgetset functions.

Marc


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TChart - How to read first/last values from DbChartSource after zoom

2013-05-10 Thread Gabor Boros

Hi,

I have one DBGrid and Chart(LineSeries) with same DataSource. Want to 
filter DBGrid's content depend Chart's zoom status. How to read the 
actual first/last values from Chart if it zoomed?


Gabor

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TChart - How to read first/last values from DbChartSource after zoom

2013-05-10 Thread Alexander Klenin
On Sat, May 11, 2013 at 3:19 AM, Gabor Boros gaborbo...@yahoo.com wrote:
 Hi,

 I have one DBGrid and Chart(LineSeries) with same DataSource. Want to filter
 DBGrid's content depend Chart's zoom status. How to read the actual
 first/last values from Chart if it zoomed?


You can use TChart.CurrentExtent property to determine currently
visible chart area.
See http://wiki.lazarus.freepascal.org/TAChart_documentation#Extents

--
Alexander S. Klenin

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Leonardo M . Ramé
Hi, I'm writing text over TFPImageCanvas using a TFreeTypeFont, and I
noted some times, the text contains wrong colors around the pixels of
the text.

I've attached an image to show the problem. As you can see, the text
over light gray and white is adding red dots, that doesn't have to be
there.

The resulting image is an TFPMemoryImage composed of two TFPImageCanvas
one containing the image and a 2nd one containing the text.

How can I avoid those red dots?.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com
attachment: freetypefont.png--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Michael Van Canneyt



On Fri, 10 May 2013, Leonardo M. Ramé wrote:


Hi, I'm writing text over TFPImageCanvas using a TFreeTypeFont, and I
noted some times, the text contains wrong colors around the pixels of
the text.

I've attached an image to show the problem. As you can see, the text
over light gray and white is adding red dots, that doesn't have to be
there.

The resulting image is an TFPMemoryImage composed of two TFPImageCanvas
one containing the image and a 2nd one containing the text.

How can I avoid those red dots?.


Are you using antialiasing ?
If so, try switching it off.

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Leonardo M . Ramé
On 2013-05-10 20:34:00 +0200, Michael Van Canneyt wrote:
 
 
 On Fri, 10 May 2013, Leonardo M. Ramé wrote:
 
 Hi, I'm writing text over TFPImageCanvas using a TFreeTypeFont, and I
 noted some times, the text contains wrong colors around the pixels of
 the text.
 
 I've attached an image to show the problem. As you can see, the text
 over light gray and white is adding red dots, that doesn't have to be
 there.
 
 The resulting image is an TFPMemoryImage composed of two TFPImageCanvas
 one containing the image and a 2nd one containing the text.
 
 How can I avoid those red dots?.
 
 Are you using antialiasing ?
 If so, try switching it off.
 

Thanks, after setting AntiAliased to false, the red dots where removed,
but fonts look really ugly (like shrinked or something). Please take a
look at the attached image, the font is Arial 10.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com
attachment: Captura de pantalla - 100513 - 15:37:49.png--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Michael Van Canneyt



On Fri, 10 May 2013, Leonardo M. Ramé wrote:


On 2013-05-10 20:34:00 +0200, Michael Van Canneyt wrote:



On Fri, 10 May 2013, Leonardo M. Ramé wrote:


Hi, I'm writing text over TFPImageCanvas using a TFreeTypeFont, and I
noted some times, the text contains wrong colors around the pixels of
the text.

I've attached an image to show the problem. As you can see, the text
over light gray and white is adding red dots, that doesn't have to be
there.

The resulting image is an TFPMemoryImage composed of two TFPImageCanvas
one containing the image and a 2nd one containing the text.

How can I avoid those red dots?.


Are you using antialiasing ?
If so, try switching it off.



Thanks, after setting AntiAliased to false, the red dots where removed,
but fonts look really ugly (like shrinked or something). Please take a
look at the attached image, the font is Arial 10.


Strange. Did you rescale any of the images ?

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Leonardo M . Ramé
On 2013-05-10 21:00:37 +0200, Michael Van Canneyt wrote:
 
 
 On Fri, 10 May 2013, Leonardo M. Ramé wrote:
 
 On 2013-05-10 20:34:00 +0200, Michael Van Canneyt wrote:
 
 
 On Fri, 10 May 2013, Leonardo M. Ramé wrote:
 
 Hi, I'm writing text over TFPImageCanvas using a TFreeTypeFont, and I
 noted some times, the text contains wrong colors around the pixels of
 the text.
 
 I've attached an image to show the problem. As you can see, the text
 over light gray and white is adding red dots, that doesn't have to be
 there.
 
 The resulting image is an TFPMemoryImage composed of two TFPImageCanvas
 one containing the image and a 2nd one containing the text.
 
 How can I avoid those red dots?.
 
 Are you using antialiasing ?
 If so, try switching it off.
 
 
 Thanks, after setting AntiAliased to false, the red dots where removed,
 but fonts look really ugly (like shrinked or something). Please take a
 look at the attached image, the font is Arial 10.
 
 Strange. Did you rescale any of the images ?
 

No. I've also tested writing the image to a bmp file, but the result is
the same.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Michael Van Canneyt



On Fri, 10 May 2013, Leonardo M. Ramé wrote:


On 2013-05-10 21:00:37 +0200, Michael Van Canneyt wrote:



On Fri, 10 May 2013, Leonardo M. Ramé wrote:


On 2013-05-10 20:34:00 +0200, Michael Van Canneyt wrote:



On Fri, 10 May 2013, Leonardo M. Ramé wrote:


Hi, I'm writing text over TFPImageCanvas using a TFreeTypeFont, and I
noted some times, the text contains wrong colors around the pixels of
the text.

I've attached an image to show the problem. As you can see, the text
over light gray and white is adding red dots, that doesn't have to be
there.

The resulting image is an TFPMemoryImage composed of two TFPImageCanvas
one containing the image and a 2nd one containing the text.

How can I avoid those red dots?.


Are you using antialiasing ?
If so, try switching it off.



Thanks, after setting AntiAliased to false, the red dots where removed,
but fonts look really ugly (like shrinked or something). Please take a
look at the attached image, the font is Arial 10.


Strange. Did you rescale any of the images ?



No. I've also tested writing the image to a bmp file, but the result is
the same.


Can you produce a bitmap with just the text and see what that looks like ?

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Leonardo M . Ramé
On 2013-05-10 21:29:48 +0200, Michael Van Canneyt wrote:
 
 Can you produce a bitmap with just the text and see what that looks like ?
 

I've tried that, and the result is the same.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Michael Van Canneyt



On Fri, 10 May 2013, Leonardo M. Ramé wrote:


On 2013-05-10 21:29:48 +0200, Michael Van Canneyt wrote:


Can you produce a bitmap with just the text and see what that looks like ?



I've tried that, and the result is the same.


Well. 
Normally TFPImage does not perform any transformation on the bitmaps that the freetype engine produces: 
it just copies the result to the bitmap it is treating. So if that bitmap is empty, you get what FreeType produced.


So this is rather strange to hear. Unfortunately, I do not know what to advise, 
except debugging :(

Michael.--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFPImageCanvas and TFreeTypeFont colors

2013-05-10 Thread Leonardo M . Ramé
On 2013-05-10 21:53:21 +0200, Michael Van Canneyt wrote:
 
 
 On Fri, 10 May 2013, Leonardo M. Ramé wrote:
 
 On 2013-05-10 21:29:48 +0200, Michael Van Canneyt wrote:
 
 Can you produce a bitmap with just the text and see what that looks like ?
 
 
 I've tried that, and the result is the same.
 
 Well. Normally TFPImage does not perform any transformation on the
 bitmaps that the freetype engine produces: it just copies the result
 to the bitmap it is treating. So if that bitmap is empty, you get
 what FreeType produced.
 
 So this is rather strange to hear. Unfortunately, I do not know what to 
 advise, except debugging :(
 

Well, maybe this can help. The background image is created from an RGBA
8bit pixel array, assigned to a TFPMemoryImage this way:

FCanvasImage.Colors[lXPos, lYPos] :=
  FPColor(
lBlue shl 8 + lBlue,
lGreen shl 8 + lGreen,
lRed shl 8 + lRed,
$ff shl 8 + $ff);

lRed, lGreen and lBlue are of type byte, while FPColor needs word,
that's why I have to do the calcs. Maybe the calcs are wrong.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to disable the assembler window on Linux?

2013-05-10 Thread silvioprog
2013/5/8 Martin laza...@mfriebe.de

  You did not answer this.

 If you hit a breakpoint, do you still get the asm?


Well,

In Windows, if I put:

procedure TForm1.Button1Click(Sender: TObject);
var
  s: string;
begin
  s := 'abc';  Break point here (F5) // line 1
  ShowMessage(s); // line 2
end;

and I use Step Over (F8), the cursor go to line 2, but the same code in
Linux, go to GTK units. See:

1 - http://imagebin.org/257292
2 - http://imagebin.org/257294 (after first F8)

I don't know debug code in assembler. I'm pretty sure the problem is in the
IDE, because in Linux/GTK it is not able to debug a simple string variable.

-- 
Silvio Clécio
My public projects - github.com/silvioprog
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus