summaryrefslogtreecommitdiff
path: root/src/fltk-dialogs.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2018-05-15 16:30:58 +1000
committerJed Barber <jjbarber@y7mail.com>2018-05-15 16:30:58 +1000
commitd45103f2445ed59b7ba78faeae8061327c4ab976 (patch)
tree78b9aba4e3d7a303473400b6c809ecf657c4b9e1 /src/fltk-dialogs.adb
parent1cd018b440f80601f60908c2e5675413f5c77e25 (diff)
Fixed errors with Event Dispatch and null string pointers
Diffstat (limited to 'src/fltk-dialogs.adb')
-rw-r--r--src/fltk-dialogs.adb24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/fltk-dialogs.adb b/src/fltk-dialogs.adb
index 7f0629c..349fd1f 100644
--- a/src/fltk-dialogs.adb
+++ b/src/fltk-dialogs.adb
@@ -168,7 +168,11 @@ package body FLTK.Dialogs is
Interfaces.C.To_C (Default));
begin
-- string does not need dealloc
- return Interfaces.C.Strings.Value (Result);
+ if Result = Interfaces.C.Strings.Null_Ptr then
+ return "";
+ else
+ return Interfaces.C.Strings.Value (Result);
+ end if;
end Text_Input;
@@ -189,7 +193,11 @@ package body FLTK.Dialogs is
Interfaces.C.To_C (Default));
begin
-- string does not need dealloc
- return Interfaces.C.Strings.Value (Result);
+ if Result = Interfaces.C.Strings.Null_Ptr then
+ return "";
+ else
+ return Interfaces.C.Strings.Value (Result);
+ end if;
end Password;
@@ -248,7 +256,11 @@ package body FLTK.Dialogs is
Boolean'Pos (Relative));
begin
-- I'm... fairly sure the string does not need dealloc?
- return Interfaces.C.Strings.Value (Result);
+ if Result = Interfaces.C.Strings.Null_Ptr then
+ return "";
+ else
+ return Interfaces.C.Strings.Value (Result);
+ end if;
end Dir_Chooser;
@@ -264,7 +276,11 @@ package body FLTK.Dialogs is
Boolean'Pos (Relative));
begin
-- I'm... fairly sure the string does not need dealloc?
- return Interfaces.C.Strings.Value (Result);
+ if Result = Interfaces.C.Strings.Null_Ptr then
+ return "";
+ else
+ return Interfaces.C.Strings.Value (Result);
+ end if;
end File_Chooser;