Unexpose `UtilityFunctions::is_instance_valid()`

pull/1513/head
David Snopek 2024-07-01 12:29:28 -05:00
parent 53b546e1df
commit 56cd3fd99e
1 changed files with 9 additions and 0 deletions

View File

@ -2166,6 +2166,12 @@ def generate_utility_functions(api, output_dir):
header.append("public:") header.append("public:")
for function in api["utility_functions"]: for function in api["utility_functions"]:
if function["name"] == "is_instance_valid":
# The `is_instance_valid()` function doesn't work as developers expect, and unless used very
# carefully will cause crashes. Instead, developers should use `ObjectDB::get_instance()`
# with object ids to ensure that an instance is still valid.
continue
vararg = "is_vararg" in function and function["is_vararg"] vararg = "is_vararg" in function and function["is_vararg"]
function_signature = "\t" function_signature = "\t"
@ -2200,6 +2206,9 @@ def generate_utility_functions(api, output_dir):
source.append("") source.append("")
for function in api["utility_functions"]: for function in api["utility_functions"]:
if function["name"] == "is_instance_valid":
continue
vararg = "is_vararg" in function and function["is_vararg"] vararg = "is_vararg" in function and function["is_vararg"]
function_signature = make_signature("UtilityFunctions", function) function_signature = make_signature("UtilityFunctions", function)