View Issue Details

IDProjectCategoryView StatusLast Update
0031893LazarusIDEpublic2017-05-23 09:48
ReporterZoran Vučenović Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platform32-bitOSWindows 
Product Version1.8RC1 
Target Version1.8 
Summary0031893: Access violation in Tools->Example Projects...
DescriptionIf you press ESC before examples list is filled, you get Access violation.
Steps To ReproduceFrom IDE's main menu choose Tools->Example projects...
Before the list is filled press ESC (you need to be quick) and see.
Additional InformationReported in forum by user Benjiro (http://forum.lazarus.freepascal.org/index.php/topic,36930.msg246914.html#msg246914).
So, I tried and yes, the IDE crashes with Acess Violation.
TagsNo tags attached.
Fixed in Revisionr55058
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Juha Manninen

2017-05-22 21:14

developer  

0001-LCL-Disconnect-OnIdle-handler-of-FilterEdit-when-the.patch (1,152 bytes)   
From f702096feafd697db6a33f574c4cf5a3ba9d3024 Mon Sep 17 00:00:00 2001
From: juha <juha.manninen62@gmail.com>
Date: Mon, 22 May 2017 22:08:12 +0300
Subject: [PATCH] LCL: Disconnect OnIdle handler of FilterEdit when the control
 is destroyed.

---
 lcl/editbtn.pas | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lcl/editbtn.pas b/lcl/editbtn.pas
index 4401adcb..343b3173 100644
--- a/lcl/editbtn.pas
+++ b/lcl/editbtn.pas
@@ -221,6 +221,7 @@ type
       ItemData: Pointer): Boolean;
     function DoDefaultFilterItem(const ACaption, FilterLC: string;
       const ItemData: Pointer): Boolean; virtual;
+    procedure DestroyWnd; override;
     procedure EditKeyDown(var Key: Word; Shift: TShiftState); override;
     procedure EditChange; override;
     procedure ButtonClick; override;
@@ -1117,6 +1118,12 @@ begin
   Result := (FilterLC='') or (Pos(FilterLC,UTF8LowerCase(ACaption))>0);
 end;
 
+procedure TCustomControlFilterEdit.DestroyWnd;
+begin
+  IdleConnected:=false;
+  inherited DestroyWnd;
+end;
+
 function TCustomControlFilterEdit.DoFilterItem(const ACaption,
   FilterLC: string; ItemData: Pointer): Boolean;
 var
-- 
2.13.0

Juha Manninen

2017-05-22 21:15

developer   ~0100608

Last edited: 2017-05-22 21:33

View 2 revisions

A possible patch is attached.
"LCL: Disconnect OnIdle handler of FilterEdit when the control is destroyed."
It solves similar potential errors in other windows where FilterEdits are used.

Michl, please check.

Michl

2017-05-22 21:39

developer   ~0100610

Yes, it works fine here! Thank you

Juha Manninen

2017-05-23 09:48

developer   ~0100617

Applied.

Issue History

Date Modified Username Field Change
2017-05-22 18:08 Zoran Vučenović New Issue
2017-05-22 18:14 Zoran Vučenović Additional Information Updated View Revisions
2017-05-22 20:10 Michl Assigned To => Michl
2017-05-22 20:10 Michl Status new => assigned
2017-05-22 21:14 Juha Manninen File Added: 0001-LCL-Disconnect-OnIdle-handler-of-FilterEdit-when-the.patch
2017-05-22 21:15 Juha Manninen Note Added: 0100608
2017-05-22 21:33 Juha Manninen Note Edited: 0100608 View Revisions
2017-05-22 21:38 Michl Assigned To Michl => Juha Manninen
2017-05-22 21:39 Michl Note Added: 0100610
2017-05-23 08:46 Juha Manninen Target Version => 1.8
2017-05-23 09:48 Juha Manninen Fixed in Revision => r55058
2017-05-23 09:48 Juha Manninen Note Added: 0100617
2017-05-23 09:48 Juha Manninen Status assigned => resolved
2017-05-23 09:48 Juha Manninen Resolution open => fixed