View Issue Details

IDProjectCategoryView StatusLast Update
0033273LazarusLCLpublic2018-03-01 16:12
ReporterMichl Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platform64bitOSWindows 
Product Version1.9 (SVN) 
Summary0033273: After revision 56235 a exception is called when a app with a DBGrid is closed
DescriptionAfter revision 56235 in some cases a exception is called when a app with a DBGrid is closed. I created a minimal example to show the bug.
Steps To ReproduceTry added project with a DBGrid and a BufDataset.
- select a entry <> first entry in DBGrid
- press Button1 to set DataSource1.DataSet := nil;
  -> a exception is called
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0032623 resolvedJuha Manninen Patches IDE crash on opening Tools, Options, User Defined Markup 

Activities

Michl

2018-02-28 11:15

developer  

BufdatasetTest.zip (2,095 bytes)

Michl

2018-02-28 11:19

developer  

grids.pas.patch (503 bytes)   
Index: lcl/grids.pas
===================================================================
--- lcl/grids.pas	(revision 57377)
+++ lcl/grids.pas	(working copy)
@@ -3434,8 +3434,6 @@
 { Returns a reactagle corresponding to a physical cell[aCol,aRow] }
 function TCustomGrid.CellRect(ACol, ARow: Integer): TRect;
 begin
-  Assert( (ACol<ColCount) and (ARow<RowCount),
-    Format('TCustomGrid.CellRect: ACol (%d) or ARow (%d) out of range.',[ACol,ARow]) );
   CellRectValid(ACol, ARow, Result);
 end;
 
grids.pas.patch (503 bytes)   

Michl

2018-02-28 11:24

developer   ~0106737

The patch works here, but it's just a workaround.

Juha Manninen

2018-02-28 14:24

developer   ~0106751

Please test with r57416.
The solution is not ideal. I think TCustomGrid.CellRect should never be called with invalid Row and Col. Their validity should be checked beforehand.
Now TCustomGrid.CellRect returns Rect(0,0,0,0) as a fallback value.
Please feel free to improve.

Michl

2018-03-01 16:12

developer   ~0106802

Yes, it works as before. Not the best solution I know, but it is a very limited case. So IMHO here a new update counter isn't needed.

Thank you.

Issue History

Date Modified Username Field Change
2018-02-28 11:14 Michl New Issue
2018-02-28 11:14 Michl Status new => assigned
2018-02-28 11:14 Michl Assigned To => Michl
2018-02-28 11:15 Michl File Added: BufdatasetTest.zip
2018-02-28 11:15 Michl Relationship added related to 0032623
2018-02-28 11:16 Michl Assigned To Michl => Juha Manninen
2018-02-28 11:19 Michl File Added: grids.pas.patch
2018-02-28 11:24 Michl Note Added: 0106737
2018-02-28 14:24 Juha Manninen Note Added: 0106751
2018-02-28 14:24 Juha Manninen Status assigned => feedback
2018-03-01 16:12 Michl Note Added: 0106802
2018-03-01 16:12 Michl Status feedback => assigned
2018-03-01 16:12 Michl Status assigned => closed
2018-03-01 16:12 Michl Resolution open => fixed