@@ -23,7 +23,9 @@ class SentryNative {
2323 : _lookup = lookup;
2424
2525 /// Decrements the reference count on the value.
26- void value_decref (
26+ /// Returns 0 if the value was freed or is a primitive (no tracking needed),
27+ /// or non-zero if it still has references.
28+ int value_decref (
2729 sentry_value_u value,
2830 ) {
2931 return _value_decref (
@@ -32,10 +34,10 @@ class SentryNative {
3234 }
3335
3436 late final _value_decrefPtr =
35- _lookup< ffi.NativeFunction <ffi.Void Function (sentry_value_u)>> (
37+ _lookup< ffi.NativeFunction <ffi.Int Function (sentry_value_u)>> (
3638 'sentry_value_decref' );
3739 late final _value_decref =
38- _value_decrefPtr.asFunction< void Function (sentry_value_u)> ();
40+ _value_decrefPtr.asFunction< int Function (sentry_value_u)> ();
3941
4042 /// Creates a null value.
4143 sentry_value_u value_new_null () {
@@ -306,7 +308,7 @@ class SentryNative {
306308 late final _value_as_int32 =
307309 _value_as_int32Ptr.asFunction< int Function (sentry_value_u)> ();
308310
309- /// Converts a value into a 64bit signed integer.
311+ /// Converts a value into a 64-bit signed integer.
310312 int value_as_int64 (
311313 sentry_value_u value,
312314 ) {
@@ -321,7 +323,7 @@ class SentryNative {
321323 late final _value_as_int64 =
322324 _value_as_int64Ptr.asFunction< int Function (sentry_value_u)> ();
323325
324- /// Converts a value into a 64bit unsigned integer.
326+ /// Converts a value into a 64-bit unsigned integer.
325327 int value_as_uint64 (
326328 sentry_value_u value,
327329 ) {
0 commit comments