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
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
Telegram bots API Wrapper
by
Renat.Su
[
Today
at 07:51:49 pm]
Unselect all rows in stri...
by
Jonny
[
Today
at 07:44:56 pm]
using RunCommand to wrap ...
by
nomorelogic
[
Today
at 07:33:53 pm]
"set of": order of elemen...
by
440bx
[
Today
at 07:27:57 pm]
Custom self drawn compone...
by
wp
[
Today
at 06:29:29 pm]
working on multiple proje...
by
TRon
[
Today
at 05:39:14 pm]
Problema como barra de ro...
by
mfdzerohour
[
Today
at 05:14:28 pm]
Error, the IF function do...
by
wp
[
Today
at 05:09:15 pm]
image processing library
by
JernejL
[
Today
at 04:27:07 pm]
Form Positioning (Run & D...
by
Tony Stone
[
Today
at 02:42:14 pm]
Reading and writing AVIF ...
by
Tomxe
[
Today
at 02:34:13 pm]
visasession
by
CM630
[
Today
at 02:31:43 pm]
User Domain
by
Zvoni
[
Today
at 12:50:56 pm]
Pointer and/xor set failu...
by
BrunoK
[
Today
at 12:41:51 pm]
Dialogs and Windows PE
by
d2010
[
Today
at 11:52:49 am]
What is more (memory) eff...
by
DragoRosso
[
Today
at 11:51:34 am]
Crosshair following Point...
by
wp
[
Today
at 11:21:28 am]
Please explain what is Po...
by
Warfley
[
Today
at 10:52:25 am]
AutoFormat IDE plugin
by
TRon
[
Today
at 08:58:29 am]
Trying to save an Animate...
by
zxandris
[
Today
at 06:58:04 am]
Re: [EXAMPLE] Adding Rich...
by
TRon
[
Today
at 05:44:02 am]
Artifacts when displaying...
by
lainz
[
Today
at 03:12:49 am]
No pointers for Records?
by
cousinp
[February 05, 2025, 10:38:17 pm]
StrToInt not raising an e...
by
Bart
[February 05, 2025, 10:23:22 pm]
App Bundle Icon Overridde...
by
msintle
[February 05, 2025, 09:35:24 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Modification of TCDEdit's destructor (Read 2318 times)
lagprogramming
Sr. Member
Posts: 407
[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: 2818
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: 2524
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