diff options
Diffstat (limited to 'src/fltk-widgets-buttons-light-check.adb')
-rw-r--r-- | src/fltk-widgets-buttons-light-check.adb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/fltk-widgets-buttons-light-check.adb b/src/fltk-widgets-buttons-light-check.adb index 1d72d47..c906a6c 100644 --- a/src/fltk-widgets-buttons-light-check.adb +++ b/src/fltk-widgets-buttons-light-check.adb @@ -35,6 +35,9 @@ package body FLTK.Widgets.Buttons.Light.Check is procedure Draw_Hook (U : in System.Address) is + package Check_Button_Convert is new + System.Address_To_Access_Conversions (Check_Button'Class); + Ada_Check_Button : access Check_Button'Class := Check_Button_Convert.To_Pointer (U); begin @@ -56,12 +59,12 @@ package body FLTK.Widgets.Buttons.Light.Check is procedure Finalize (This : in out Check_Button) is begin - Finalize (Light_Button (This)); - if (This.Void_Ptr /= System.Null_Address) then - if This in Check_Button then - free_fl_check_button (This.Void_Ptr); - end if; + if This in Check_Button and then + This.Void_Ptr /= System.Null_Address + then + free_fl_check_button (This.Void_Ptr); end if; + Finalize (Light_Button (This)); end Finalize; |