Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into merge_avplay
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowei-guan committed Dec 15, 2023
2 parents 8902865 + 623cd21 commit ee651d7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions packages/tizen_bundle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT

* Increase the minimum Flutter version to 3.3.
* Fix token in finalizer to be different from value.

## 0.1.1

Expand Down
11 changes: 6 additions & 5 deletions packages/tizen_bundle/lib/tizen_bundle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ class Bundle extends MapMixin<String, Object> {
/// Creates an empty [Bundle].
Bundle() {
_handle = tizen.bundle_create();
_finalizer.attach(this, this, detach: this);
_finalizer.attach(this, _handle, detach: this);
}

/// Creates a [Bundle] from the encoded bundle string.
Bundle.decode(String raw) {
_handle = tizen.bundle_decode(
raw.toNativeInt8().cast<UnsignedChar>(), raw.length);
_finalizer.attach(this, this, detach: this);
_finalizer.attach(this, _handle, detach: this);
}

/// Creates a copy of the given [bundle].
Bundle.fromBundle(Bundle bundle) {
_handle = tizen.bundle_dup(bundle._handle);
_finalizer.attach(this, this, detach: this);
_finalizer.attach(this, _handle, detach: this);
}

/// Creates a [Bundle] from the given [map].
Expand All @@ -44,8 +44,9 @@ class Bundle extends MapMixin<String, Object> {
}

late final Pointer<bundle> _handle;
static final Finalizer<Bundle> _finalizer =
Finalizer<Bundle>((Bundle bundle) => tizen.bundle_free(bundle._handle));
static final Finalizer<Pointer<bundle>> _finalizer =
Finalizer<Pointer<bundle>>(
(Pointer<bundle> bundle) => tizen.bundle_free(bundle));

static final List<String> _keys = <String>[];

Expand Down
4 changes: 4 additions & 0 deletions packages/tizen_rpc_port/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Fix token in finalizer to be different from value.

## 0.1.3

* Remove unnecessary `StreamHandlerError` implementation.
Expand Down
9 changes: 3 additions & 6 deletions packages/tizen_rpc_port/lib/src/proxy_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,13 @@ abstract class ProxyBase {
return pProxy.value;
});

_finalizer.attach(this, this);
_finalizer.attach(this, _handle);
}

late final rpc_port_proxy_h _handle;

final Finalizer<ProxyBase> _finalizer =
Finalizer<ProxyBase>((ProxyBase proxy) {
proxy._streamSubscription?.cancel();
tizen.rpc_port_proxy_destroy(proxy._handle);
});
final Finalizer<rpc_port_proxy_h> _finalizer = Finalizer<rpc_port_proxy_h>(
(rpc_port_proxy_h handle) => tizen.rpc_port_proxy_destroy(handle));

/// The server application ID.
final String appid;
Expand Down
7 changes: 3 additions & 4 deletions packages/tizen_rpc_port/lib/src/stub_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ abstract class StubBase {
return pStub.value;
});

_finalizer.attach(this, this);
_finalizer.attach(this, _handle);
}

late final rpc_port_stub_h _handle;

final Finalizer<StubBase> _finalizer = Finalizer<StubBase>((StubBase stub) {
stub.close();
});
final Finalizer<rpc_port_stub_h> _finalizer = Finalizer<rpc_port_stub_h>(
(rpc_port_stub_h handle) => tizen.rpc_port_stub_destroy(handle));

/// A port name to use when listening for connections.
final String portName;
Expand Down

0 comments on commit ee651d7

Please sign in to comment.