Skip to content

Commit

Permalink
Merge pull request #1513 from dsnopek/unexpose-is-instance-valid
Browse files Browse the repository at this point in the history
Unexpose `UtilityFunctions::is_instance_valid()`
  • Loading branch information
dsnopek authored Jul 15, 2024
2 parents 8012716 + 56cd3fd commit 0a1e31f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions binding_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,12 @@ def generate_utility_functions(api, output_dir):
header.append("public:")

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"]

function_signature = "\t"
Expand Down Expand Up @@ -2200,6 +2206,9 @@ def generate_utility_functions(api, output_dir):
source.append("")

for function in api["utility_functions"]:
if function["name"] == "is_instance_valid":
continue

vararg = "is_vararg" in function and function["is_vararg"]

function_signature = make_signature("UtilityFunctions", function)
Expand Down

0 comments on commit 0a1e31f

Please sign in to comment.