@bits-innovate/react-native-vstarcam 1.0.51 → 1.0.52

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.
@@ -60,6 +60,9 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
60
60
  private static Object commandListenerProxy;
61
61
  private static Object releaseListenerProxy;
62
62
 
63
+ // Hard reference root to completely prevent Dalvik GC of our JNI proxies
64
+ private static final java.util.ArrayList<Object> jniProxyRoots = new java.util.ArrayList<>();
65
+
63
66
  // Static context reference for reloads
64
67
  private static java.lang.ref.WeakReference<ReactApplicationContext> currentContext;
65
68
 
@@ -283,6 +286,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
283
286
  }
284
287
  }
285
288
  );
289
+ jniProxyRoots.add(stateListenerProxy);
286
290
 
287
291
  // Create dynamic proxy for ClientCommandListener
288
292
  commandListenerProxy = Proxy.newProxyInstance(
@@ -326,6 +330,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
326
330
  }
327
331
  }
328
332
  );
333
+ jniProxyRoots.add(commandListenerProxy);
329
334
 
330
335
  // Create dynamic proxy for ClientReleaseListener
331
336
  releaseListenerProxy = Proxy.newProxyInstance(
@@ -352,6 +357,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
352
357
  }
353
358
  }
354
359
  );
360
+ jniProxyRoots.add(releaseListenerProxy);
355
361
 
356
362
  // Call JNIApi.init(stateListener, commandListener, releaseListener)
357
363
  Method initMethod = VStarCamModule.jniApiClass.getMethod("init",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",