summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-text_displays.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-widgets-groups-text_displays.adb')
-rw-r--r--src/fltk-widgets-groups-text_displays.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fltk-widgets-groups-text_displays.adb b/src/fltk-widgets-groups-text_displays.adb
index 0c90bec..011d841 100644
--- a/src/fltk-widgets-groups-text_displays.adb
+++ b/src/fltk-widgets-groups-text_displays.adb
@@ -478,8 +478,11 @@ package body FLTK.Widgets.Groups.Text_Displays is
Extra_Final (This);
if This.Void_Ptr /= Null_Pointer and This.Needs_Dealloc then
free_fl_text_display (This.Void_Ptr);
- free_fl_text_buffer (This.Raw_Buffer);
This.Void_Ptr := Null_Pointer;
+ if This.Raw_Buffer /= Null_Pointer then
+ free_fl_text_buffer (This.Raw_Buffer); -- buffer is reference counted
+ This.Raw_Buffer := Null_Pointer;
+ end if;
end if;
end Finalize;