summaryrefslogtreecommitdiff
path: root/src/fltk-text_buffers.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2024-11-17 17:15:53 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2024-11-17 17:15:53 +1300
commit619b3da9fbb37c57aedfc039cc813f6acf5569be (patch)
tree5577d1594900cd5e23afbc792d31ba9a40818d55 /src/fltk-text_buffers.adb
parentf5f77c762534ed15adc557009d1a645e5fd998a5 (diff)
Refactored Finalize subprograms and made note of potential future Widget issues there in fltk.ads
Diffstat (limited to 'src/fltk-text_buffers.adb')
-rw-r--r--src/fltk-text_buffers.adb14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/fltk-text_buffers.adb b/src/fltk-text_buffers.adb
index d859b26..e3755a1 100644
--- a/src/fltk-text_buffers.adb
+++ b/src/fltk-text_buffers.adb
@@ -515,11 +515,8 @@ package body FLTK.Text_Buffers is
procedure Finalize
(This : in out Text_Buffer) is
begin
- if This.Void_Ptr /= Null_Pointer and then
- This in Text_Buffer'Class
- then
+ if This.Void_Ptr /= Null_Pointer and This.Needs_Dealloc then
free_fl_text_buffer (This.Void_Ptr);
- This.Void_Ptr := Null_Pointer;
end if;
end Finalize;
@@ -535,13 +532,8 @@ package body FLTK.Text_Buffers is
begin
return This : Text_Buffer do
This.Void_Ptr := new_fl_text_buffer
- (Interfaces.C.int (Requested_Size),
- Interfaces.C.int (Preferred_Gap_Size));
-
- This.Modify_CBs := Modify_Vectors.Empty_Vector;
- This.Predelete_CBs := Predelete_Vectors.Empty_Vector;
- This.CB_Active := True;
-
+ (Interfaces.C.int (Requested_Size),
+ Interfaces.C.int (Preferred_Gap_Size));
fl_text_buffer_add_modify_callback
(This.Void_Ptr,
Storage.To_Integer (Modify_Callback_Hook'Address),