Page 1 of 2

Porting to Delphi 10.1 Berlin

Posted: Tue May 09, 2017 9:39 am
by 16580071
Hi,
I've made a porting of one of my dll modules that uses TeeChart. The version is 2016.19.

I've the same module running without problem in XE2 environment with TeeChart 2012.

When I run my module in debug point it give me an Out Of Memory error with the Stack Trace in the attached picture.

What can be?

Re: Porting to Delphi 10.1 Berlin

Posted: Tue May 09, 2017 10:07 am
by yeray
Hello,

There could be some memory leak.
Could you please try to arrange a simple example project we can run as-is to reproduce the problem here? Of course it would be out of your library, just using a TChart in a form.

Re: Porting to Delphi 10.1 Berlin

Posted: Wed May 10, 2017 8:18 am
by 16580071
Hi Yeray,
It was a bit complicated but I did it :D

The problem seems to be this type of assigment

Code: Select all

serie2.DataSource:= serie1;
and then call a function on serie2.

Code: Select all

serie2.SetFunction(TAverageTeeFunction.Create(Self));
I try to attach the project but it seem that the download fails.

How can I send it to you?

Re: Porting to Delphi 10.1 Berlin

Posted: Wed May 10, 2017 8:52 am
by 16580071
I've made some other check, and I discover that this code

Code: Select all

procedure TForm2.FormShow(Sender: TObject);
var
  FPunti  : Integer;
  FValore : Integer;
begin
  FormatSettings.DecimalSeparator:= '.';
  FChart:= TChart.Create(Self);
  FChart.Parent:= cxTabSheet1;
  FChart.Align:= alClient;
  FChart.Gradient.Visible:= True;
  FChart.Gradient.StartColor:= clLime;
  FChart.Gradient.EndColor  := clWhite;
  FSerie:= TLineSeries.Create(Self);
  FChart.AddSeries(FSerie);
  FSerie2:= TLineSeries.Create(Self);
  FChart.AddSeries(FSerie2);

  for FPunti:= 1 to 8 do
    FSerie.Add(42);

  FSerie2.DataSource:= FSerie;
  FSerie2.SetFunction(TAverageTeeFunction.Create(Self));
end;
give error if instead of an integer number (in this case 42) i've a floting pont number (42.3) for example.

Re: Porting to Delphi 10.1 Berlin

Posted: Wed May 10, 2017 1:51 pm
by yeray
Hello,

Try enabling TEEVALUEEXTENDED: at TeeDefs.inc, change the following lines:

Code: Select all

{$DEFINE TEEVALUEDOUBLE}
{.$DEFINE TEEVALUESINGLE}
{.$DEFINE TEEVALUEEXTENDED}
For these:

Code: Select all

{.$DEFINE TEEVALUEDOUBLE}
{.$DEFINE TEEVALUESINGLE}
{$DEFINE TEEVALUEEXTENDED}

Re: Porting to Delphi 10.1 Berlin

Posted: Wed May 10, 2017 1:56 pm
by 16580071
Hi have more than one file with this name. In which folder I've to change it?

Then I've to recompile components?

Re: Porting to Delphi 10.1 Berlin

Posted: Thu May 11, 2017 6:14 am
by yeray
Hello,

Sorry, indeed you have to recompile the sources after modifying that.

Re: Porting to Delphi 10.1 Berlin

Posted: Thu May 11, 2017 7:31 am
by 16580071
If I try to change this optionr when I execute TeeRecompile i receive this error

===============================================
TeeChart Pro
Compilation started: 11/05/2017 09:30:29

Win32 v24 (Delphi 10.1 Berlin and C++Builder 10.1 Berlin Update 2) (C++)
Tee924

Cannot recompile Delphi package: Tee924.dpk
Embarcadero Delphi for Win32 compiler version 31.0
Copyright (c) 1983,2016 Embarcadero Technologies, Inc.
VCLTee.TeEngine.pas(4034) Error: E1035 Return value of function 'TChartAxis.IncDec' might be undefined
Tee924.dpk(40) Fatal: F2063 Could not compile used unit 'VCLTee.TeEngine.pas'
EXCEPTION:
Compilation aborted.
--------------------------------------------

Re: Porting to Delphi 10.1 Berlin

Posted: Thu May 11, 2017 8:19 am
by yeray
Hello,

I could reproduce this error with TeeChart v2016.19 and Berlin.
It works fine with the latest TeeChart v2017.21.

Another alternative is to handle the situation setting an axis range manually. Ie:

Code: Select all

FChart.Axes.Left.SetMinMax(42, 42.6);

Re: Porting to Delphi 10.1 Berlin

Posted: Thu May 11, 2017 11:46 am
by 16580071
Ok,
I've updated the to .21 and after TeeDefs.inc was updated I can compile and install components.

Now the short program that I've sent to you is working, but my dll goes always out of memory.

It's not possible to set a TeamViewer or another remote control session to check the problem on my sources?

Re: Porting to Delphi 10.1 Berlin

Posted: Fri May 12, 2017 8:04 am
by yeray
Hello,
LucaC wrote:I've updated the to .21 and after TeeDefs.inc was updated I can compile and install components.

Now the short program that I've sent to you is working, but my dll goes always out of memory.
It seems to work for me here with the following test application:
TeeChart_GDIPlus_exe_and_dll_memoryleak.zip
(57.87 KiB) Downloaded 726 times
LucaC wrote:It's not possible to set a TeamViewer or another remote control session to check the problem on my sources?
Yes, I'll will send you a mail with instructions.

Re: Porting to Delphi 10.1 Berlin

Posted: Fri May 12, 2017 8:17 am
by yeray
Hi again,

Too fast...
It works for me with RAD 10.2 Tokyo, but I rechecked it with RAD 10.1 Berlin (to be sure to be doing the same than you) and the problem is still reproducible with it!
I'll will investigate the problem and I'll be back to you here asap.

Re: Porting to Delphi 10.1 Berlin

Posted: Fri May 12, 2017 8:18 am
by 16580071
Ok, I'll wait your instructions.

Thank you :)

Re: Porting to Delphi 10.1 Berlin

Posted: Mon May 15, 2017 7:49 am
by 16580071
Hi Yeray,
have you any news about my two problems?

I need to fix all within the end of the week.

Thank you,
Luca

Re: Porting to Delphi 10.1 Berlin

Posted: Mon May 15, 2017 8:05 am
by yeray
Hi Luca,

While we investigate if there's anything we can do to solve that problem in Berlin, have you checked if the SetMinMax workaround (suggested here) is acceptable for you?