diff options
Diffstat (limited to 'src/fltk-widgets-buttons-light.adb')
-rw-r--r-- | src/fltk-widgets-buttons-light.adb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fltk-widgets-buttons-light.adb b/src/fltk-widgets-buttons-light.adb index e3b1cfd..77b8ee1 100644 --- a/src/fltk-widgets-buttons-light.adb +++ b/src/fltk-widgets-buttons-light.adb @@ -59,10 +59,11 @@ package body FLTK.Widgets.Buttons.Light is procedure Finalize (This : in out Light_Button) is begin - if This in Light_Button and then - This.Void_Ptr /= System.Null_Address + if This.Void_Ptr /= System.Null_Address and then + This in Light_Button'Class then free_fl_light_button (This.Void_Ptr); + This.Void_Ptr := System.Null_Address; end if; Finalize (Button (This)); end Finalize; |