summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-text_displays-text_editors.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-05-10 20:07:16 +1000
committerJed Barber <jjbarber@y7mail.com>2017-05-10 20:07:16 +1000
commit703c2e726a75cbedb43d3105f9e0b2bab9e59e77 (patch)
treee62b5012c27d295e590bef9a7cac89bb08ee026d /src/fltk-widgets-groups-text_displays-text_editors.adb
parent9dcf299b63268278b0a9a27ed2dc600f19e458b2 (diff)
Fixed Finalize inheritance bug
Diffstat (limited to 'src/fltk-widgets-groups-text_displays-text_editors.adb')
-rw-r--r--src/fltk-widgets-groups-text_displays-text_editors.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fltk-widgets-groups-text_displays-text_editors.adb b/src/fltk-widgets-groups-text_displays-text_editors.adb
index 2424a7e..06564ef 100644
--- a/src/fltk-widgets-groups-text_displays-text_editors.adb
+++ b/src/fltk-widgets-groups-text_displays-text_editors.adb
@@ -85,11 +85,12 @@ package body FLTK.Widgets.Groups.Text_Displays.Text_Editors is
procedure Finalize
(This : in out Text_Editor) is
begin
- if This in Text_Editor and then
- This.Void_Ptr /= System.Null_Address
+ if This.Void_Ptr /= System.Null_Address and then
+ This in Text_Editor'Class
then
This.Clear;
free_fl_text_editor (This.Void_Ptr);
+ This.Void_Ptr := System.Null_Address;
end if;
Finalize (Text_Display (This));
end Finalize;