summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-help_views.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-14 01:54:17 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-14 01:54:17 +1300
commit1ba99737bca1136170f04b3a46659deb042e3fcd (patch)
tree9b42991aa5aed8c76abcd1bf5ba980e249f0de28 /src/fltk-widgets-groups-help_views.adb
parent88ca2ea14ba6651404cd4ea347ac8f06afdd0558 (diff)
Fixed a number of issues with getting the Ada wrapper back given a C++ widget pointer
Diffstat (limited to 'src/fltk-widgets-groups-help_views.adb')
-rw-r--r--src/fltk-widgets-groups-help_views.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fltk-widgets-groups-help_views.adb b/src/fltk-widgets-groups-help_views.adb
index c6f4602..ec8688d 100644
--- a/src/fltk-widgets-groups-help_views.adb
+++ b/src/fltk-widgets-groups-help_views.adb
@@ -243,9 +243,11 @@ package body FLTK.Widgets.Groups.Help_Views is
S : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Strings.chars_ptr
is
- Ada_Help_View : access Help_View'Class :=
- Help_View_Convert.To_Pointer (Storage.To_Address (fl_widget_get_user_data (V)));
+ User_Data : Storage.Integer_Address := fl_widget_get_user_data (V);
+ Ada_Help_View : access Help_View'Class;
begin
+ pragma Assert (User_Data /= Null_Pointer);
+ Ada_Help_View := Help_View_Convert.To_Pointer (Storage.To_Address (User_Data));
if Ada_Help_View.Zelda = null then
return S;
end if;
@@ -257,6 +259,8 @@ package body FLTK.Widgets.Groups.Help_Views is
else
return Ada_Help_View.Hilda;
end if;
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Link_Callback_Hook;