frida 17.2.9 → 17.2.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frida",
3
- "version": "17.2.9",
3
+ "version": "17.2.11",
4
4
  "authors": [
5
5
  "Frida Developers"
6
6
  ],
@@ -1742,16 +1742,12 @@ fdn_signal_closure_deliver (napi_env env,
1742
1742
  FdnSignalClosureMessageDestroy * d = &message->payload.destroy;
1743
1743
  napi_value js_sig;
1744
1744
  FdnSignal * sig;
1745
- FdnSignalBehavior behavior;
1746
1745
 
1747
1746
  napi_get_reference_value (env, d->js_sig, &js_sig);
1748
1747
  napi_unwrap (env, js_sig, (void **) &sig);
1749
- behavior = sig->behavior;
1750
1748
 
1751
1749
  napi_delete_reference (env, d->handler);
1752
1750
  napi_delete_reference (env, d->js_sig);
1753
- if (behavior == FDN_SIGNAL_KEEP_ALIVE)
1754
- napi_unref_threadsafe_function (env, d->tsfn);
1755
1751
  napi_release_threadsafe_function (d->tsfn, napi_tsfn_abort);
1756
1752
 
1757
1753
  break;
@@ -1814,7 +1810,7 @@ fdn_keep_alive_until (napi_env env,
1814
1810
  context->handle = g_object_ref (handle);
1815
1811
  context->signal_handler_id = 0;
1816
1812
 
1817
- napi_ref_threadsafe_function (env, fdn_keep_alive_tsfn);
1813
+ napi_create_threadsafe_function (env, NULL, NULL, fdn_utf8_to_value (env, "FridaKeepAlive"), 0, 1, NULL, NULL, context, fdn_keep_alive_on_tsfn_invoke, &context->tsfn);
1818
1814
 
1819
1815
  napi_add_finalizer (env, js_object, context, fdn_keep_alive_on_finalize, NULL, NULL);
1820
1816
 
@@ -1860,10 +1856,15 @@ fdn_keep_alive_on_destroy_signal_handler_detached (gpointer data,
1860
1856
  static void
1861
1857
  fdn_keep_alive_schedule_cleanup (FdnKeepAliveContext * context)
1862
1858
  {
1859
+ napi_threadsafe_function tsfn;
1860
+
1863
1861
  if (fdn_in_cleanup)
1864
1862
  return;
1865
1863
 
1866
- napi_call_threadsafe_function (fdn_keep_alive_tsfn, context, napi_tsfn_blocking);
1864
+ if ((tsfn = g_atomic_pointer_exchange (&context->tsfn, NULL)) != NULL)
1865
+ napi_call_threadsafe_function (tsfn, tsfn, napi_tsfn_blocking);
1866
+ else
1867
+ fdn_keep_alive_context_unref (context);
1867
1868
  }
1868
1869
 
1869
1870
  static void
@@ -1872,19 +1873,23 @@ fdn_keep_alive_on_tsfn_invoke (napi_env env,
1872
1873
  void * context,
1873
1874
  void * data)
1874
1875
  {
1875
- FdnKeepAliveContext * ctx = data;
1876
+ FdnKeepAliveContext * ctx = context;
1877
+ napi_threadsafe_function tsfn = data;
1876
1878
 
1877
- if (ctx->signal_handler_id != 0)
1878
- {
1879
- g_signal_handler_disconnect (ctx->handle, ctx->signal_handler_id);
1880
- ctx->signal_handler_id = 0;
1879
+ g_signal_handler_disconnect (ctx->handle, ctx->signal_handler_id);
1880
+ ctx->signal_handler_id = 0;
1881
1881
 
1882
- g_object_unref (ctx->handle);
1883
- ctx->handle = NULL;
1882
+ g_object_unref (ctx->handle);
1883
+ ctx->handle = NULL;
1884
1884
 
1885
- napi_unref_threadsafe_function (env, fdn_keep_alive_tsfn);
1886
- }
1885
+ napi_release_threadsafe_function (tsfn, napi_tsfn_abort);
1887
1886
 
1887
+ fdn_keep_alive_context_unref (ctx);
1888
+ }
1889
+
1890
+ static void
1891
+ fdn_keep_alive_context_unref (FdnKeepAliveContext * ctx)
1892
+ {
1888
1893
  if (g_atomic_int_dec_and_test (&ctx->ref_count))
1889
1894
  g_slice_free (FdnKeepAliveContext, ctx);
1890
1895
  }
@@ -69,6 +69,7 @@ static void fdn_keep_alive_on_destroy_signal (GObject * handle, gpointer user_da
69
69
  static void fdn_keep_alive_on_destroy_signal_handler_detached (gpointer data, GClosure * closure);
70
70
  static void fdn_keep_alive_schedule_cleanup (FdnKeepAliveContext * context);
71
71
  static void fdn_keep_alive_on_tsfn_invoke (napi_env env, napi_value js_cb, void * context, void * data);
72
+ static void fdn_keep_alive_context_unref (FdnKeepAliveContext * ctx);
72
73
 
73
74
  static void fdn_inherit_val_val (napi_env env, napi_value sub_ctor, napi_value super_ctor, napi_value object_ctor, napi_value set_proto);
74
75
  G_GNUC_UNUSED static void fdn_inherit_val_ref (napi_env env, napi_value sub_ctor, napi_ref super_ctor, napi_value object_ctor, napi_value set_proto);
@@ -52,6 +52,7 @@ typedef struct {
52
52
  guint ref_count;
53
53
  GObject * handle;
54
54
  gulong signal_handler_id;
55
+ napi_threadsafe_function tsfn;
55
56
  } FdnKeepAliveContext;
56
57
 
57
58
  typedef gboolean (* FdnIsDestroyedFunc) (GObject * handle);
@@ -1,6 +1,6 @@
1
1
  [wrap-git]
2
2
  url = https://github.com/frida/frida-core.git
3
- revision = 17.2.9
3
+ revision = 17.2.11
4
4
  depth = 1
5
5
 
6
6
  [provide]