@capacitor/ios 8.6.1-nightly-20261111T150738.0 → 8.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -882,11 +882,24 @@ var nativeBridge = (function (exports) {
882
882
  try {
883
883
  if (typeof postToNative === 'function') {
884
884
  let callbackId = '-1';
885
- if (storedCallback &&
885
+ // native never answers removeListener nor sends `save: false` for a removed listener,
886
+ // so release those callbacks here, otherwise everything they capture is never freed
887
+ if (methodName === 'removeListener') {
888
+ callbacks.delete(options === null || options === void 0 ? void 0 : options.callbackId);
889
+ }
890
+ else if (methodName === 'removeAllListeners') {
891
+ callbacks.forEach((stored, id) => {
892
+ if (stored.pluginName === pluginName && stored.methodName === 'addListener') {
893
+ callbacks.delete(id);
894
+ }
895
+ });
896
+ }
897
+ if (methodName !== 'removeListener' &&
898
+ storedCallback &&
886
899
  (typeof storedCallback.callback === 'function' || typeof storedCallback.resolve === 'function')) {
887
900
  // store the call for later lookup
888
901
  callbackId = String(++callbackIdCount);
889
- callbacks.set(callbackId, storedCallback);
902
+ callbacks.set(callbackId, Object.assign(Object.assign({}, storedCallback), { pluginName, methodName }));
890
903
  }
891
904
  const callData = {
892
905
  callbackId: callbackId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/ios",
3
- "version": "8.6.1-nightly-20261111T150738.0",
3
+ "version": "8.6.1",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -25,7 +25,7 @@
25
25
  "xc:build:CapacitorCordova": "cd CapacitorCordova && xcodebuild && cd .."
26
26
  },
27
27
  "peerDependencies": {
28
- "@capacitor/core": "^8.6.0-nightly-20261111T150738.0"
28
+ "@capacitor/core": "^8.6.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"