Example #1
0
void
ply_progress_free (ply_progress_t* progress)
{
  ply_list_node_t *node;
  node = ply_list_get_first_node (progress->current_message_list);

  while (node)
   {
      ply_list_node_t *next_node;
      ply_progress_message_t *message = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (progress->current_message_list, node);

      free (message->string);
      free (message);
      node = next_node;
    }
  ply_list_free (progress->current_message_list);

  node = ply_list_get_first_node (progress->previous_message_list);

  while (node)
   {
      ply_list_node_t *next_node;
      ply_progress_message_t *message = ply_list_node_get_data (node);
      next_node = ply_list_get_next_node (progress->previous_message_list, node);

      free (message->string);
      free (message);
      node = next_node;
    }
  ply_list_free (progress->previous_message_list);
  free(progress);
  return;
}
Example #2
0
void
ply_boot_client_free (ply_boot_client_t *client)
{
  if (client == NULL)
    return;

  ply_boot_client_cancel_requests (client);

  ply_list_free (client->requests_to_send);
  ply_list_free (client->requests_waiting_for_replies);

  free (client);
}
Example #3
0
void
ply_boot_server_free (ply_boot_server_t *server)
{
  ply_list_node_t *node;
  if (server == NULL)
    return;
  while ((node = ply_list_get_first_node(server->connections)))
    {
      ply_boot_connection_t *connection = ply_list_node_get_data (node);
      ply_boot_connection_on_hangup (connection);
    }
  ply_list_free (server->connections);
  ply_list_free (server->cached_passwords);
  free (server);
}
Example #4
0
static void
destroy_plugin (ply_boot_splash_plugin_t *plugin)
{
  ply_list_node_t *node;
  script_env_var_t *env_var;

  if (plugin == NULL)
    return;

  if (plugin->loop != NULL)
    {
      stop_animation (plugin);
      ply_event_loop_stop_watching_for_exit (plugin->loop,
                                             (ply_event_loop_exit_handler_t)
                                             detach_from_event_loop,
                                             plugin);
      detach_from_event_loop (plugin);
    }

  for (node = ply_list_get_first_node (plugin->script_env_vars);
       node != NULL;
       node = ply_list_get_next_node (plugin->script_env_vars, node))
    {
      env_var = ply_list_node_get_data (node);
      free (env_var->key);
      free (env_var->value);
      free (env_var);
    }
  ply_list_free (plugin->script_env_vars);
  free (plugin->script_filename);
  free (plugin->image_dir);
  free (plugin);
}
Example #5
0
void
ply_trigger_free (ply_trigger_t *trigger)
{
  ply_list_node_t *node;

  if (trigger == NULL)
    return;

  node = ply_list_get_first_node (trigger->closures);
  while (node != NULL)
    {
      ply_list_node_t *next_node;
      ply_trigger_closure_t *closure;

      closure = (ply_trigger_closure_t *) ply_list_node_get_data (node);

      next_node = ply_list_get_next_node (trigger->closures, node);

      free (closure);
      ply_list_remove_node (trigger->closures, node);

      node = next_node;
    }
  ply_list_free (trigger->closures);

  if (trigger->free_address != NULL)
    *trigger->free_address = NULL;

  if (trigger->free_address != NULL)
    *trigger->free_address = NULL;

  free (trigger);
}
Example #6
0
void
ply_region_free (ply_region_t *region)
{

  ply_region_clear (region);
  ply_list_free (region->rectangle_list);
  free (region);
}
Example #7
0
static void
destroy_backend (ply_renderer_backend_t *backend)
{
  ply_trace ("destroying renderer backend for device %s", backend->device_name);
  free_heads (backend);
  ply_list_free (backend->heads);

  free (backend->device_name);

  free (backend);
}
Example #8
0
static void script_parse_op_list_free (ply_list_t *op_list)
{
  ply_list_node_t *node;

  for (node = ply_list_get_first_node (op_list);
       node;
       node = ply_list_get_next_node (op_list, node))
    {
      script_op_t *op = ply_list_node_get_data (node);
      script_parse_op_free (op);
    }
  ply_list_free (op_list);
  return;
}
Example #9
0
static void
free_input_closures (ply_terminal_t *terminal)
{
    ply_list_node_t *node;

    node = ply_list_get_first_node (terminal->input_closures);
    while (node != NULL) {
        ply_terminal_input_closure_t *closure;
        ply_list_node_t *next_node;

        closure = ply_list_node_get_data (node);
        next_node = ply_list_get_next_node (terminal->input_closures, node);

        free (closure);
        node = next_node;
    }
    ply_list_free (terminal->input_closures);
}
Example #10
0
static void
free_views (ply_boot_splash_plugin_t *plugin)
{
        ply_list_node_t *node;

        node = ply_list_get_first_node (plugin->views);

        while (node != NULL) {
                ply_list_node_t *next_node;
                view_t *view;

                view = ply_list_node_get_data (node);
                next_node = ply_list_get_next_node (plugin->views, node);

                view_free (view);
                ply_list_remove_node (plugin->views, node);

                node = next_node;
        }

        ply_list_free (plugin->views);
        plugin->views = NULL;
}
Example #11
0
static void
free_stars (view_t *view)
{
        ply_list_node_t *node;

        assert (view != NULL);

        node = ply_list_get_first_node (view->stars);
        while (node != NULL) {
                ply_list_node_t *next_node;
                star_t *star;

                star = (star_t *) ply_list_node_get_data (node);

                next_node = ply_list_get_next_node (view->stars, node);

                star_free (star);
                node = next_node;
        }

        ply_list_free (view->stars);
        view->stars = NULL;
}
Example #12
0
static void script_parse_exp_free (script_exp_t *exp)
{
  if (!exp) return;
  switch (exp->type)
    {
      case SCRIPT_EXP_TYPE_PLUS:
      case SCRIPT_EXP_TYPE_MINUS:
      case SCRIPT_EXP_TYPE_MUL:
      case SCRIPT_EXP_TYPE_DIV:
      case SCRIPT_EXP_TYPE_MOD:
      case SCRIPT_EXP_TYPE_EQ:
      case SCRIPT_EXP_TYPE_NE:
      case SCRIPT_EXP_TYPE_GT:
      case SCRIPT_EXP_TYPE_GE:
      case SCRIPT_EXP_TYPE_LT:
      case SCRIPT_EXP_TYPE_LE:
      case SCRIPT_EXP_TYPE_AND:
      case SCRIPT_EXP_TYPE_OR:
      case SCRIPT_EXP_TYPE_EXTEND:
      case SCRIPT_EXP_TYPE_ASSIGN:
      case SCRIPT_EXP_TYPE_ASSIGN_PLUS:
      case SCRIPT_EXP_TYPE_ASSIGN_MINUS:
      case SCRIPT_EXP_TYPE_ASSIGN_MUL:
      case SCRIPT_EXP_TYPE_ASSIGN_DIV:
      case SCRIPT_EXP_TYPE_ASSIGN_MOD:
      case SCRIPT_EXP_TYPE_ASSIGN_EXTEND:
      case SCRIPT_EXP_TYPE_HASH:
        script_parse_exp_free (exp->data.dual.sub_a);
        script_parse_exp_free (exp->data.dual.sub_b);
        break;

      case SCRIPT_EXP_TYPE_NOT:
      case SCRIPT_EXP_TYPE_POS:
      case SCRIPT_EXP_TYPE_NEG:
      case SCRIPT_EXP_TYPE_PRE_INC:
      case SCRIPT_EXP_TYPE_PRE_DEC:
      case SCRIPT_EXP_TYPE_POST_INC:
      case SCRIPT_EXP_TYPE_POST_DEC:
        script_parse_exp_free (exp->data.sub);
        break;

      case SCRIPT_EXP_TYPE_TERM_NUMBER:
      case SCRIPT_EXP_TYPE_TERM_NULL:
      case SCRIPT_EXP_TYPE_TERM_LOCAL:
      case SCRIPT_EXP_TYPE_TERM_GLOBAL:
      case SCRIPT_EXP_TYPE_TERM_THIS:
        break;
      case SCRIPT_EXP_TYPE_TERM_SET:
        {
          ply_list_node_t *node;
          for (node = ply_list_get_first_node (exp->data.parameters);
               node;
               node = ply_list_get_next_node (exp->data.parameters, node))
            {
              script_exp_t *sub = ply_list_node_get_data (node);
              script_parse_exp_free (sub);
            }
          ply_list_free (exp->data.parameters);
          break;
        }
      case SCRIPT_EXP_TYPE_FUNCTION_EXE:
        {
          ply_list_node_t *node;
          for (node = ply_list_get_first_node (exp->data.function_exe.parameters);
               node;
               node = ply_list_get_next_node (exp->data.function_exe.parameters, node))
            {
              script_exp_t *sub = ply_list_node_get_data (node);
              script_parse_exp_free (sub);
            }
          ply_list_free (exp->data.function_exe.parameters);
          script_parse_exp_free (exp->data.function_exe.name);
          break;
        }
      case SCRIPT_EXP_TYPE_FUNCTION_DEF:   /* FIXME merge the frees with one from op_free */
        {
          if (exp->data.function_def->type == SCRIPT_FUNCTION_TYPE_SCRIPT) 
            script_parse_op_free (exp->data.function_def->data.script);
          ply_list_node_t *node;
          for (node = ply_list_get_first_node (exp->data.function_def->parameters);
               node;
               node = ply_list_get_next_node (exp->data.function_def->parameters, node))
            {
              char *arg = ply_list_node_get_data (node);
              free (arg);
            }
          ply_list_free (exp->data.function_def->parameters);
          free (exp->data.function_def);
          break;
        }

      case SCRIPT_EXP_TYPE_TERM_STRING:
      case SCRIPT_EXP_TYPE_TERM_VAR:
        free (exp->data.string);
        break;
    }
  script_debug_remove_element (exp);
  free (exp);
}