View Issue Details

IDProjectCategoryView StatusLast Update
0036436LazarusWidgetsetpublic2019-12-14 13:49
ReporterChris RordenAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformIntel 4770kOSUbuntuOS Version19.10
Product Version2.1 (SVN)Product Build62382 
Target VersionFixed in Version 
Summary0036436: GTK3: TComboBox csDropDownList selection crashes application
DescriptionWith GTK3, selecting an item in a TComboBox where the style is csDropDownList causes the application to crash.
TagsNo tags attached.
Fixed in Revisionr62383
LazTarget-
WidgetsetGTK 3
Attached Files
  • csDropDownList.zip (109,310 bytes)
  • cmb.diff (606 bytes)
    Index: lcl/interfaces/gtk3/gtk3cellrenderer.pas
    ===================================================================
    --- lcl/interfaces/gtk3/gtk3cellrenderer.pas	(revision 62382)
    +++ lcl/interfaces/gtk3/gtk3cellrenderer.pas	(working copy)
    @@ -272,6 +272,7 @@
       // writeln('1.minimumheight ',AMinHeight,' naturalheight ',ANaturalHeight,' min ',dbgs(minimum_height <> nil),' nat ',dbgs(natural_height <> nil));
     
       AWinControl := GetControl(cell, widget);
    +  if AWinControl = nil then exit;
       if [csDestroying,csLoading]*AWinControl.ComponentState<>[] then exit;
     
       if AWinControl is TCustomListbox then
    
    cmb.diff (606 bytes)

Activities

Chris Rorden

2019-12-13 19:48

reporter  

csDropDownList.zip (109,310 bytes)

CudaText man

2019-12-13 21:34

reporter   ~0119825

try the attached fix.

cmb.diff (606 bytes)
Index: lcl/interfaces/gtk3/gtk3cellrenderer.pas
===================================================================
--- lcl/interfaces/gtk3/gtk3cellrenderer.pas	(revision 62382)
+++ lcl/interfaces/gtk3/gtk3cellrenderer.pas	(working copy)
@@ -272,6 +272,7 @@
   // writeln('1.minimumheight ',AMinHeight,' naturalheight ',ANaturalHeight,' min ',dbgs(minimum_height <> nil),' nat ',dbgs(natural_height <> nil));
 
   AWinControl := GetControl(cell, widget);
+  if AWinControl = nil then exit;
   if [csDestroying,csLoading]*AWinControl.ComponentState<>[] then exit;
 
   if AWinControl is TCustomListbox then
cmb.diff (606 bytes)

Juha Manninen

2019-12-13 22:59

developer   ~0119827

Last edited: 2019-12-13 23:01

View 2 revisions

I came up with the same solution as CudaText man. I added the same test everywhere GetControl() was called + simplified the function a little.
Thanks for the patch anyway!
A question is why Nil was returned as a TWinControl. Anyway, it works now.
BTW, is CudaText man the same as Alexey T.?

Chris Rorden

2019-12-14 13:49

reporter   ~0119839

Thanks for the rapid fix.

Issue History

Date Modified Username Field Change
2019-12-13 19:48 Chris Rorden New Issue
2019-12-13 19:48 Chris Rorden File Added: csDropDownList.zip
2019-12-13 21:34 CudaText man File Added: cmb.diff
2019-12-13 21:34 CudaText man Note Added: 0119825
2019-12-13 22:55 Juha Manninen Assigned To => Juha Manninen
2019-12-13 22:55 Juha Manninen Status new => assigned
2019-12-13 22:59 Juha Manninen Status assigned => resolved
2019-12-13 22:59 Juha Manninen Resolution open => fixed
2019-12-13 22:59 Juha Manninen Fixed in Revision => r62383
2019-12-13 22:59 Juha Manninen LazTarget => -
2019-12-13 22:59 Juha Manninen Widgetset GTK 3 => GTK 3
2019-12-13 22:59 Juha Manninen Note Added: 0119827
2019-12-13 23:01 Juha Manninen Note Edited: 0119827 View Revisions
2019-12-14 13:49 Chris Rorden Status resolved => closed
2019-12-14 13:49 Chris Rorden Note Added: 0119839