summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-inputs-secret.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-widgets-inputs-secret.adb')
-rw-r--r--src/fltk-widgets-inputs-secret.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fltk-widgets-inputs-secret.adb b/src/fltk-widgets-inputs-secret.adb
index 46d0b0b..64f0c7f 100644
--- a/src/fltk-widgets-inputs-secret.adb
+++ b/src/fltk-widgets-inputs-secret.adb
@@ -59,10 +59,11 @@ package body FLTK.Widgets.Inputs.Secret is
procedure Finalize
(This : in out Secret_Input) is
begin
- if This in Secret_Input and then
- This.Void_Ptr /= System.Null_Address
+ if This.Void_Ptr /= System.Null_Address and then
+ This in Secret_Input'Class
then
free_fl_secret_input (This.Void_Ptr);
+ This.Void_Ptr := System.Null_Address;
end if;
Finalize (Input (This));
end Finalize;