Skip to content

Commit

Permalink
[cpp] Null Check Interfaces (#11743)
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Aug 1, 2024
1 parent 00947ed commit 9993fe5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/generators/gencpp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4719,6 +4719,7 @@ let gen_member_def ctx class_def is_static is_interface field =
let cast = "::hx::interface_cast< ::" ^ join_class_path_remap class_def.cl_path "::" ^ "_obj *>" in
output (" " ^ returnType ^ " (::hx::Object :: *_hx_" ^ remap_name ^ ")(" ^ argList ^ "); \n");
output (" static inline " ^ returnType ^ " " ^ remap_name ^ "( ::Dynamic _hx_" ^ commaArgList ^ ") {\n");
output (" if (::hx::IsNull(_hx_)) ::hx::NullReference(\"Object\", false); \n");
output (" " ^ returnStr ^ "(_hx_.mPtr->*( " ^ cast ^ "(_hx_.mPtr->_hx_getInterface(" ^ (cpp_class_hash class_def) ^ ")))->_hx_" ^ remap_name ^ ")(" ^ cpp_arg_names args ^ ");\n }\n" );
end
| _ -> ( )
Expand Down

0 comments on commit 9993fe5

Please sign in to comment.