Skip to content

Commit

Permalink
Fix orphaned crypto object
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtonmeuser committed Oct 14, 2023
1 parent d9ac329 commit 677a5d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define PRINT_ERROR(message) _err_print_error(__FUNCTION__, __FILE__, __LINE__, "Godot Wasm: " + String(message))
#define godot_error Error
#define REGISTRATION_METHOD _bind_methods
#define RANDOM_BYTES(n) Crypto().generate_random_bytes(n)
#define RANDOM_BYTES(n) [n]()->PackedByteArray{Ref<Crypto> c;c.instantiate();return c->generate_random_bytes(n);}()
#endif
#define FAIL(message, ret) do { PRINT_ERROR(message); return ret; } while (0)
#define FAIL_IF(cond, message, ret) if (unlikely(cond)) FAIL(message, ret)
Expand Down

0 comments on commit 677a5d1

Please sign in to comment.