Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Widgetset
»
CustomDrawn
»
[SOLVED] Modification of TCDEdit's destructor
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Anyone interested in test...
by
MathMan
[
Today
at 01:13:53 pm]
[SOLVED] TLabeledEdit.Edi...
by
jipété
[
Today
at 01:07:05 pm]
Compare strange character...
by
cdbc
[
Today
at 12:02:48 pm]
[SOLVED]Bash commands and...
by
johnathan
[
Today
at 11:58:02 am]
[SOLVED] How to detect if...
by
Hartmut
[
Today
at 11:46:07 am]
TStringGrid with stretche...
by
wp
[
Today
at 11:42:30 am]
fpconnect (from sockets u...
by
MarkMLl
[
Today
at 10:49:53 am]
Feature announcement: Fun...
by
marcov
[
Today
at 10:36:25 am]
(new Topic) i can't inata...
by
majid.ebru
[
Today
at 10:14:40 am]
Form creator for editing ...
by
krzynio
[
Today
at 10:13:48 am]
i can't inatall Dam dialo...
by
majid.ebru
[
Today
at 10:12:23 am]
Windows. Status Drives Se...
by
Bart
[
Today
at 09:50:54 am]
QT5 ide tooltips
by
zeljko
[
Today
at 09:38:58 am]
CORDIC algorithms
by
Thaddy
[
Today
at 09:00:18 am]
Installing Lazarus on a R...
by
guachipelintree
[
Today
at 08:51:15 am]
Unique Instance Terminate...
by
Weitentaaal
[
Today
at 08:41:57 am]
Lazarus Release Candidate...
by
dbannon
[
Today
at 07:24:07 am]
License Agreement
by
RayoGlauco
[December 04, 2023, 11:33:44 pm]
How to print a DrawGrid
by
wp
[December 04, 2023, 11:29:20 pm]
virus with lazarus-3.0RC2...
by
rvk
[December 04, 2023, 11:11:01 pm]
Online Package Manager
by
wp
[December 04, 2023, 07:57:56 pm]
Flock of Birds
by
Dzandaa
[December 04, 2023, 05:30:05 pm]
https page download
by
BubikolRamios
[December 04, 2023, 04:11:51 pm]
Unable to write "/usr/sha...
by
Thaddy
[December 04, 2023, 02:26:11 pm]
[SOLVED] TStringGrid.Colu...
by
wp
[December 04, 2023, 11:03:07 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Modification of TCDEdit's destructor (Read 898 times)
lagprogramming
Sr. Member
Posts: 390
[SOLVED] Modification of TCDEdit's destructor
«
on:
July 11, 2023, 11:21:14 am »
lcl/customdrawncontrols.pas has the following destructor:
Code: Pascal
[Select]
[+]
[-]
destructor
TCDEdit
.
Destroy
;
begin
inherited
Destroy
;
FLines
.
Free
;
//FCaretTimer.Free; Don't free here because it is assigned with a owner
end
;
inherited Destroy;
is followed by a
FLines.Free;
line, where
FLines
is a
TStringList
.
The following patch modifies the destructor in order to free
FLines
before
inherited Destroy;
.
Code: Pascal
[Select]
[+]
[-]
diff
--
git a
/
lcl
/
customdrawncontrols
.
pas
b
/
lcl
/
customdrawncontrols
.
pas
index
d9b6bb2035
..
2b852abf5c
100644
---
a
/
lcl
/
customdrawncontrols
.
pas
+++
b
/
lcl
/
customdrawncontrols
.
pas
@@
-
2044
,
8
+
2044
,
8
@@
end
;
destructor
TCDEdit
.
Destroy
;
begin
-
inherited
Destroy
;
FLines
.
Free
;
+
inherited
Destroy
;
//FCaretTimer.Free; Don't free here because it is assigned with a owner
end
;
«
Last Edit: July 19, 2023, 12:09:47 pm by lagprogramming
»
Logged
Zvoni
Hero Member
Posts: 2033
Re: Modification of TCDEdit's destructor
«
Reply #1 on:
July 11, 2023, 11:28:57 am »
Interesting.
I was always under the impression, that Inherited Destroy; should always be called last in your own destructor (meaning cleaning up your own mess before .... )
Logged
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
AlexTP
Hero Member
Posts: 2292
Re: [CLOSED] Modification of TCDEdit's destructor
«
Reply #2 on:
July 18, 2023, 06:48:35 pm »
Posted to
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40387
Logged
CudaText editor
-
ATSynEdit
-
More from me
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Widgetset
»
CustomDrawn
»
[SOLVED] Modification of TCDEdit's destructor
TinyPortal
© 2005-2018