[SOLVED]SIGSEVG in 'tatools.pas' at line 772;when creating a chart toolset dynam lazarus / 55-TAChart ---------------------------------------------------------------------- CM630 · 2014-02-05 10:06 My code Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   myChart: TChart;   ctMain: TChartToolset;   ctMainPanUD:  TPanDragTool; begin   myChart:=  TChart.Create (Form1);   myChart.Visible:=True;   myChart.Parent:= Form1;   ctMain:= TChartToolset.Create (myChart);   ctMainPanUD:= TPanDragTool.Create(ctMain);   ctMainPanUD.Directions:=[pdUp,pdDown];   ctMainPanUD.Shift:=[ssAlt,ssLeft];   ctMainPanUD.Enabled:=True;   ctMain.Tools.Add (ctMainPanUD);   myChart.Toolset:=ctMain; end;  crashes the app (sigsegv) with message QuoteIn file 'tatools.pas' at line 772; Toolset.FIsHandled := true;  The TATOOLS code is Code: [Select]procedure TChartTool.Handled; begin   Toolset.FIsHandled := true; end;  When the chart, toolset  and tools are created statically everything is fine. ---------------------------------------------------------------------- wp · 2014-02-05 11:52 There had been similar discussions in the forum: Don't use TToolset.Add to add tools, but set the tool's property Toolset instead. The property setter calls the Add, plus sets the "Toolset" member of the new tool, and this avoids the crash: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   myChart: TChart;   ctMain: TChartToolset;   ctMainPanUD:  TPanDragTool; begin   myChart:=  TChart.Create (Form1);   myChart.Visible:=True;   myChart.Parent:= Form1;   ctMain:= TChartToolset.Create (myChart);   ctMainPanUD:= TPanDragTool.Create(ctMain);   ctMainPanUD.Directions:=[pdUp,pdDown];   ctMainPanUD.Shift:=[ssAlt,ssLeft];   ctMainPanUD.Enabled:=True;   //ctMain.Tools.Add (ctMainPanUD);  // wrong   ctMainPanUD.Toolset := ctMain;     // correct   myChart.Toolset:=ctMain; end;