diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-05-07 12:04:33 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-05-07 12:04:33 +1000 |
commit | df843c7fe48f33d25981d03975e670a3e7159031 (patch) | |
tree | 32ad270bf18d5bedadd255a42c0b013332609488 /src/fltk-widgets-groups-windows-single.adb | |
parent | c2c5985b130e02b970cb6bf88c9a81e6e72c6646 (diff) |
Further code cleanup
Diffstat (limited to 'src/fltk-widgets-groups-windows-single.adb')
-rw-r--r-- | src/fltk-widgets-groups-windows-single.adb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fltk-widgets-groups-windows-single.adb b/src/fltk-widgets-groups-windows-single.adb index 320ea3c..ea7590c 100644 --- a/src/fltk-widgets-groups-windows-single.adb +++ b/src/fltk-widgets-groups-windows-single.adb @@ -48,6 +48,9 @@ package body FLTK.Widgets.Groups.Windows.Single is procedure Draw_Hook (U : in System.Address) is + package Single_Window_Convert is new + System.Address_To_Access_Conversions (Single_Window'Class); + Ada_Window : access Single_Window'Class := Single_Window_Convert.To_Pointer (U); begin @@ -69,12 +72,13 @@ package body FLTK.Widgets.Groups.Windows.Single is procedure Finalize (This : in out Single_Window) is begin - Finalize (Window (This)); - if This.Void_Ptr /= System.Null_Address then - if This in Single_Window then - free_fl_single_window (This.Void_Ptr); - end if; + if This in Single_Window and then + This.Void_Ptr /= System.Null_Address + then + This.Clear; + free_fl_single_window (This.Void_Ptr); end if; + Finalize (Window (This)); end Finalize; |