summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-buttons-light-round.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-05-07 12:04:33 +1000
committerJed Barber <jjbarber@y7mail.com>2017-05-07 12:04:33 +1000
commitdf843c7fe48f33d25981d03975e670a3e7159031 (patch)
tree32ad270bf18d5bedadd255a42c0b013332609488 /src/fltk-widgets-buttons-light-round.adb
parentc2c5985b130e02b970cb6bf88c9a81e6e72c6646 (diff)
Further code cleanup
Diffstat (limited to 'src/fltk-widgets-buttons-light-round.adb')
-rw-r--r--src/fltk-widgets-buttons-light-round.adb13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/fltk-widgets-buttons-light-round.adb b/src/fltk-widgets-buttons-light-round.adb
index 941d416..769f556 100644
--- a/src/fltk-widgets-buttons-light-round.adb
+++ b/src/fltk-widgets-buttons-light-round.adb
@@ -35,6 +35,9 @@ package body FLTK.Widgets.Buttons.Light.Round is
procedure Draw_Hook
(U : in System.Address)
is
+ package Round_Button_Convert is new
+ System.Address_To_Access_Conversions (Round_Button'Class);
+
Ada_Round_Button : access Round_Button'Class :=
Round_Button_Convert.To_Pointer (U);
begin
@@ -56,12 +59,12 @@ package body FLTK.Widgets.Buttons.Light.Round is
procedure Finalize
(This : in out Round_Button) is
begin
- Finalize (Light_Button (This));
- if (This.Void_Ptr /= System.Null_Address) then
- if This in Round_Button then
- free_fl_round_button (This.Void_Ptr);
- end if;
+ if This in Round_Button and then
+ This.Void_Ptr /= System.Null_Address
+ then
+ free_fl_round_button (This.Void_Ptr);
end if;
+ Finalize (Light_Button (This));
end Finalize;