diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2024-10-13 03:33:38 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2024-10-13 03:33:38 +1300 |
commit | b4090a7acddf951088b75fcce0d6edb721bbbf45 (patch) | |
tree | 6770ea43f82e114c188538213f77e76b4eb5da10 /src/fltk-widgets-groups-text_displays.ads | |
parent | 87671a2f2423efacd0b0c4ad0c34c244680ef565 (diff) |
Fixed bug with Text_Buffers not being deallocated correctly if declared after the Text_Display they are attached to
Diffstat (limited to 'src/fltk-widgets-groups-text_displays.ads')
-rw-r--r-- | src/fltk-widgets-groups-text_displays.ads | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/fltk-widgets-groups-text_displays.ads b/src/fltk-widgets-groups-text_displays.ads index 609561e..76cff42 100644 --- a/src/fltk-widgets-groups-text_displays.ads +++ b/src/fltk-widgets-groups-text_displays.ads @@ -359,6 +359,7 @@ private type Text_Display is new Group with record Buffer : access FLTK.Text_Buffers.Text_Buffer; + Raw_Buffer : Storage.Integer_Address := Null_Pointer; Style_Callback : Styles.Unfinished_Style_Callback; end record; @@ -373,6 +374,21 @@ private + -- Adds some basic reference counting on the C side to help ensure any Text_Buffers + -- do not get deallocated before all Text_Displays they might be attached to. + procedure upref_fl_text_buffer + (TB : in Storage.Integer_Address); + pragma Import (C, upref_fl_text_buffer, "upref_fl_text_buffer"); + pragma Inline (upref_fl_text_buffer); + + procedure free_fl_text_buffer + (TB : in Storage.Integer_Address); + pragma Import (C, free_fl_text_buffer, "free_fl_text_buffer"); + pragma Inline (free_fl_text_buffer); + + + + pragma Inline (Get_Buffer); pragma Inline (Set_Buffer); |