Exemple #1
0
void
gum_allocator_probe_detach (GumAllocatorProbe * self)
{
  GumAllocatorProbePrivate * priv = self->priv;
  guint i;

  gum_interceptor_ignore_current_thread (priv->interceptor);

  gum_interceptor_detach_listener (priv->interceptor,
      GUM_INVOCATION_LISTENER (self));

  for (i = 0; i < priv->function_contexts->len; i++)
  {
    FunctionContext * function_ctx = (FunctionContext *)
        g_ptr_array_index (priv->function_contexts, i);
    g_free (function_ctx);
  }

  g_ptr_array_set_size (priv->function_contexts, 0);

  priv->malloc_count = 0;
  priv->realloc_count = 0;
  priv->free_count = 0;

  gum_interceptor_unignore_current_thread (priv->interceptor);
}
Exemple #2
0
static void
gum_duk_invocation_listener_destroy (GumDukInvocationListener * listener)
{
  gum_interceptor_detach_listener (listener->module->interceptor,
      GUM_INVOCATION_LISTENER (listener));
  g_object_unref (listener);
}
static void
test_interceptor_fixture_teardown (TestInterceptorFixture * fixture,
                                   gconstpointer data)
{
  guint i;

  (void) data;

  for (i = 0; i < G_N_ELEMENTS (fixture->listener_context); i++)
  {
    DarwinListenerContext * ctx = fixture->listener_context[i];

    if (ctx != NULL)
    {
      gum_interceptor_detach_listener (fixture->interceptor,
          GUM_INVOCATION_LISTENER (ctx));
      g_object_unref (ctx);
    }
  }

  g_string_free (fixture->result, TRUE);
  g_object_unref (fixture->interceptor);
}