From 0b54224ecfffbe6103d3f15034fd345c7fabf695 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 2 Apr 2021 11:29:54 +0200 Subject: [PATCH] fix, editor lclref count <> 0 when closed using a shortcut --- CHANGELOG.md | 1 + src/u_editor.pas | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ba75947..091ffd5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Editor tabs: caption not updated when split page is closed using the File menu or the shortcut. - Editor shortcuts: no applied to current editor until restart or file close/reopen. +- Editor: fix possible freeze when closed using a shortcut. # v3.9.9 diff --git a/src/u_editor.pas b/src/u_editor.pas index a94e151b..172f617b 100644 --- a/src/u_editor.pas +++ b/src/u_editor.pas @@ -631,7 +631,10 @@ begin showWidget; doc.disableFileDateCheck:=true; pageControl.pageIndex:=index; - doc.Free; + if doc.LCLRefCount > 0 then + application.ReleaseComponent(doc) + else + doc.Free; result := true; end;