summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-buttons-radio.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-widgets-buttons-radio.adb')
-rw-r--r--src/fltk-widgets-buttons-radio.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fltk-widgets-buttons-radio.adb b/src/fltk-widgets-buttons-radio.adb
index 2b932c3..25fedc0 100644
--- a/src/fltk-widgets-buttons-radio.adb
+++ b/src/fltk-widgets-buttons-radio.adb
@@ -59,10 +59,11 @@ package body FLTK.Widgets.Buttons.Radio is
procedure Finalize
(This : in out Radio_Button) is
begin
- if This in Radio_Button and then
- This.Void_Ptr /= System.Null_Address
+ if This.Void_Ptr /= System.Null_Address and then
+ This in Radio_Button'Class
then
free_fl_radio_button (This.Void_Ptr);
+ This.Void_Ptr := System.Null_Address;
end if;
Finalize (Button (This));
end Finalize;