예제 #1
0
static void
egg_state_machine_finalize (GObject *object)
{
  EggStateMachine *self = (EggStateMachine *)object;
  EggStateMachinePrivate *priv = egg_state_machine_get_instance_private (self);
  GHashTableIter state_iter;
  EggState *state;

  g_hash_table_iter_init (&state_iter, priv->states);
  while (g_hash_table_iter_next (&state_iter, NULL, (gpointer)&state))
    {
      GHashTableIter iter;
      gpointer key;

      g_hash_table_iter_init (&iter, state->bindings);
      while (g_hash_table_iter_next (&iter, &key, NULL))
        {
          g_object_weak_unref (key,
                               egg_state_machine__binding_source_weak_notify,
                               self);
        }

      g_hash_table_iter_init (&iter, state->signals);
      while (g_hash_table_iter_next (&iter, &key, NULL))
        {
          g_object_weak_unref (key,
                               egg_state_machine__signal_source_weak_notify,
                               self);
        }
    }

  g_clear_pointer (&priv->states, g_hash_table_unref);
  g_clear_pointer (&priv->state, g_free);

  G_OBJECT_CLASS (egg_state_machine_parent_class)->finalize (object);
}
예제 #2
0
파일: util.c 프로젝트: jordanl/transmission
static void
freespace_label_data_free (gpointer gdata)
{
  struct freespace_label_data * data = gdata;

  if (data->core != NULL)
    g_object_weak_unref (G_OBJECT(data->core), on_freespace_label_core_destroyed, data);

  if (data->label != NULL)
    g_object_weak_ref (G_OBJECT(data->label), on_freespace_label_destroyed, data);

  g_source_remove (data->timer_id);
  g_free (data->dir);
  g_free (data);
}
예제 #3
0
static void
writeback_file_data_free (WritebackFileData *data)
{
	if (data->self) {
		g_object_weak_unref (G_OBJECT (data->self), self_weak_notify, data);
	}

	g_object_unref (data->fs);
	g_object_unref (data->file);
	g_strfreev (data->rdf_types);
	g_ptr_array_unref (data->results);
	g_cancellable_disconnect (data->cancellable, data->cancel_id);
	g_object_unref (data->cancellable);
	g_free (data);
}
예제 #4
0
파일: gailbutton.c 프로젝트: BYC/gtk
static void
gail_button_notify_label_weak_ref (gpointer data, GObject* obj)
{
  GtkLabel *label = NULL;
  GailButton *button = NULL;

  label = GTK_LABEL (obj);
  if (data && GAIL_IS_BUTTON (data))
    {
      button = GAIL_BUTTON (ATK_OBJECT (data));
      if (button)
        g_object_weak_unref (G_OBJECT (button), gail_button_notify_weak_ref,
                             label);
    }
}
예제 #5
0
static void
source_dispose (GObject *object)
{
	ESourcePrivate *priv;

	priv = E_SOURCE_GET_PRIVATE (object);

	if (priv->group != NULL) {
		g_object_weak_unref (G_OBJECT (priv->group), (GWeakNotify) group_weak_notify, object);
		priv->group = NULL;
	}

	/* Chain up to parent's dispose() method. */
	G_OBJECT_CLASS (e_source_parent_class)->dispose (object);
}
예제 #6
0
static void
on_data_binding_destroy(GitgDataBinding *binding, GObject *object)
{
	Binding *bd = binding->source.object == object ? &binding->dest : &binding->source;

	/* disconnect notify handler */
	if (bd->notify_id)
		g_signal_handler_disconnect(bd->object, bd->notify_id);

	/* remove weak ref */
	g_object_weak_unref(bd->object, (GWeakNotify)on_data_binding_destroy, binding);

	/* finalize binding */
	gitg_data_binding_finalize(binding);
}
예제 #7
0
void soy_controllers_pointer_set_position (soycontrollersPointer* self, soyatomsPosition* value) {
	soyatomsPosition* _tmp0_ = NULL;
	soyatomsPosition* _tmp1_ = NULL;
	soyatomsPosition* _tmp5_ = NULL;
	soyatomsPosition* _tmp6_ = NULL;
	soyatomsPosition* _tmp7_ = NULL;
#line 86 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	g_return_if_fail (self != NULL);
#line 87 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	_tmp0_ = value;
#line 87 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	_soy_controllers_pointer_position_set (self, _tmp0_);
#line 88 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	_tmp1_ = self->priv->_position_obj;
#line 88 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	if (_tmp1_ != NULL) {
#line 392 "Pointer.c"
		soyatomsPosition* _tmp2_ = NULL;
		guint _tmp3_ = 0U;
		soyatomsPosition* _tmp4_ = NULL;
#line 89 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
		_tmp2_ = self->priv->_position_obj;
#line 89 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
		g_signal_parse_name ("on-set", SOY_ATOMS_TYPE_POSITION, &_tmp3_, NULL, FALSE);
#line 89 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
		g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) __soy_controllers_pointer_position_set_soy_atoms_position_on_set, self);
#line 90 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
		_tmp4_ = self->priv->_position_obj;
#line 90 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
		g_object_weak_unref ((GObject*) _tmp4_, __soy_controllers_pointer_position_weak_gweak_notify, self);
#line 406 "Pointer.c"
	}
#line 91 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	_tmp5_ = value;
#line 91 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	self->priv->_position_obj = _tmp5_;
#line 92 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	_tmp6_ = value;
#line 92 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	g_signal_connect_object (_tmp6_, "on-set", (GCallback) __soy_controllers_pointer_position_set_soy_atoms_position_on_set, self, 0);
#line 93 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	_tmp7_ = value;
#line 93 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	g_object_weak_ref ((GObject*) _tmp7_, __soy_controllers_pointer_position_weak_gweak_notify, self);
#line 86 "/home/jeff/Documents/libraries/libsoy/src/controllers/Pointer.gs"
	g_object_notify ((GObject *) self, "position");
#line 422 "Pointer.c"
}
예제 #8
0
파일: Hinge.c 프로젝트: couchjd/playground
void soy_joints_hinge_set_axis (soyjointsHinge* self, soyatomsAxis* value) {
	soyatomsAxis* _tmp0_ = NULL;
	soyatomsAxis* _tmp1_ = NULL;
	soyatomsAxis* _tmp5_ = NULL;
	soyatomsAxis* _tmp6_ = NULL;
	soyatomsAxis* _tmp7_ = NULL;
#line 124 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_return_if_fail (self != NULL);
#line 125 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp0_ = value;
#line 125 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_soy_joints_hinge_axis_set (self, _tmp0_);
#line 126 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp1_ = self->priv->_axis_obj;
#line 126 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	if (_tmp1_ != NULL) {
#line 939 "Hinge.c"
		soyatomsAxis* _tmp2_ = NULL;
		guint _tmp3_ = 0U;
		soyatomsAxis* _tmp4_ = NULL;
#line 127 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp2_ = self->priv->_axis_obj;
#line 127 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_signal_parse_name ("on-set", SOY_ATOMS_TYPE_AXIS, &_tmp3_, NULL, FALSE);
#line 127 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) __soy_joints_hinge_axis_set_soy_atoms_axis_on_set, self);
#line 128 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp4_ = self->priv->_axis_obj;
#line 128 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_object_weak_unref ((GObject*) _tmp4_, __soy_joints_hinge_axis_weak_gweak_notify, self);
#line 953 "Hinge.c"
	}
#line 129 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp5_ = value;
#line 129 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	self->priv->_axis_obj = _tmp5_;
#line 130 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp6_ = value;
#line 130 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_signal_connect_object (_tmp6_, "on-set", (GCallback) __soy_joints_hinge_axis_set_soy_atoms_axis_on_set, self, 0);
#line 131 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp7_ = value;
#line 131 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_object_weak_ref ((GObject*) _tmp7_, __soy_joints_hinge_axis_weak_gweak_notify, self);
#line 124 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_object_notify ((GObject *) self, "axis");
#line 969 "Hinge.c"
}
예제 #9
0
파일: Hinge.c 프로젝트: couchjd/playground
void soy_joints_hinge_set_anchor (soyjointsHinge* self, soyatomsPosition* value) {
	soyatomsPosition* _tmp0_ = NULL;
	soyatomsPosition* _tmp1_ = NULL;
	soyatomsPosition* _tmp5_ = NULL;
	soyatomsPosition* _tmp6_ = NULL;
	soyatomsPosition* _tmp7_ = NULL;
#line 79 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_return_if_fail (self != NULL);
#line 80 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp0_ = value;
#line 80 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_soy_joints_hinge_anchor_set (self, _tmp0_);
#line 81 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp1_ = self->priv->_anchor_obj;
#line 81 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	if (_tmp1_ != NULL) {
#line 682 "Hinge.c"
		soyatomsPosition* _tmp2_ = NULL;
		guint _tmp3_ = 0U;
		soyatomsPosition* _tmp4_ = NULL;
#line 82 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp2_ = self->priv->_anchor_obj;
#line 82 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_signal_parse_name ("on-set", SOY_ATOMS_TYPE_POSITION, &_tmp3_, NULL, FALSE);
#line 82 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) __soy_joints_hinge_anchor_set_soy_atoms_position_on_set, self);
#line 83 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp4_ = self->priv->_anchor_obj;
#line 83 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_object_weak_unref ((GObject*) _tmp4_, __soy_joints_hinge_anchor_weak_gweak_notify, self);
#line 696 "Hinge.c"
	}
#line 84 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp5_ = value;
#line 84 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	self->priv->_anchor_obj = _tmp5_;
#line 85 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp6_ = value;
#line 85 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_signal_connect_object (_tmp6_, "on-set", (GCallback) __soy_joints_hinge_anchor_set_soy_atoms_position_on_set, self, 0);
#line 86 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp7_ = value;
#line 86 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_object_weak_ref ((GObject*) _tmp7_, __soy_joints_hinge_anchor_weak_gweak_notify, self);
#line 79 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_object_notify ((GObject *) self, "anchor");
#line 712 "Hinge.c"
}
예제 #10
0
static void
wnck_window_opened_cb (WnckScreen *screen,
                       WnckWindow *window,
                       GvaProcess *process)
{
        GPid pid;

        /* XXX This is totally non-portable. */
        pid = (GPid) wnck_window_get_pid (window);

        /* XXX The process ID for SDLMAME windows currently comes back 0.
         *     We can use this as a heuristic for matching SDLMAME windows
         *     to SDLMAME processes.  But it's not perfect. */
        if (pid != gva_process_get_pid (process) && pid != 0)
                return;

        /*** From this point forward, assume we have a match. ***/

        /* Exchange the weak reference for a real reference. */
        g_object_weak_unref (
                g_object_ref (process), (GWeakNotify)
                wnck_weak_notify_cb, screen);

        /* Bind the referenced process to the window. */
        g_object_set_data_full (
                G_OBJECT (window), "process", process,
                (GDestroyNotify) g_object_unref);

        /* No need to be notified of new windows anymore. */
        g_signal_handler_disconnect (screen, window_opened_handler_id);
        window_opened_handler_id = 0;

        wnck_window_initialize (window);

        g_signal_connect (
                window, "geometry-changed",
                G_CALLBACK (wnck_window_timeout_reset), NULL);

        g_signal_connect (
                window, "state-changed",
                G_CALLBACK (wnck_window_timeout_reset), NULL);

        g_signal_connect (
                screen, "window-closed",
                G_CALLBACK (wnck_window_closed_cb), NULL);

        gva_main_cursor_normal ();
}
예제 #11
0
static void
egg_state_style_free (gpointer data)
{
  EggStateStyle *style = data;

  if (style->widget != NULL)
    {
      g_object_weak_unref (G_OBJECT (style->widget),
                           egg_state_machine__style_object_weak_notify,
                           style);
      style->widget = NULL;
    }

  g_free (style->name);
  g_slice_free (EggStateStyle, style);
}
static void
pnl_dock_transient_grab_remove_index (PnlDockTransientGrab *self,
                                      guint                 index)
{
  PnlDockItem *item;

  g_return_if_fail (PNL_IS_DOCK_TRANSIENT_GRAB (self));
  g_return_if_fail (index < self->items->len);

  item = g_ptr_array_index (self->items, index);
  g_object_weak_unref (G_OBJECT (item),
                       pnl_dock_transient_grab_weak_notify,
                       self);
  g_ptr_array_remove_index (self->items, index);
  g_hash_table_remove (self->hidden, item);
}
static void
pnl_dock_transient_grab_finalize (GObject *object)
{
  PnlDockTransientGrab *self = (PnlDockTransientGrab *)object;
  guint i;

  for (i = 0; i < self->items->len; i++)
    g_object_weak_unref (g_ptr_array_index (self->items, i),
                         pnl_dock_transient_grab_weak_notify,
                         self);

  g_clear_pointer (&self->items, g_ptr_array_unref);
  g_clear_pointer (&self->hidden, g_hash_table_unref);

  G_OBJECT_CLASS (pnl_dock_transient_grab_parent_class)->finalize (object);
}
static void
xfdesktop_clipboard_manager_file_destroyed (XfdesktopClipboardManager *manager,
                                            XfdesktopFileIcon             *file)
{
  g_return_if_fail (XFDESKTOP_IS_CLIPBOARD_MANAGER (manager));
  g_return_if_fail (g_list_find (manager->files, file) != NULL);

  /* remove the file from our list */
  manager->files = g_list_remove (manager->files, file);

  /* disconnect from the file */
  g_object_weak_unref(G_OBJECT (file),
                      (GWeakNotify)xfdesktop_clipboard_manager_file_destroyed,
                      manager);
  g_object_unref (G_OBJECT (file));
}
예제 #15
0
static gboolean
shm_writer_fd_cb (GIOChannel *source,
    GIOCondition condition,
    gpointer data)
{
  ShmWriterPrivate *priv = SHM_WRITER (data)->priv;

  if (condition == G_IO_IN)
    {
      ShmWriterClientPair *pair;
      ShmClient *client;
      int fd;

      client = sp_writer_accept_client (priv->writer);

      if (client == NULL)
        goto out;

      /* Start listening on this socket.
       * This socket is used for the actual shm data transfer signaling
       * of an individual client. So when this socket is closed, the
       * client associated with this particular socket has disconnected */
      pair = g_slice_new0 (ShmWriterClientPair);
      pair->self = data;
      pair->client = client;

      fd = sp_writer_get_client_fd (client);

      shm_writer_add_fd_source (data, fd, shm_writer_client_fd_cb,
          pair, (GDestroyNotify)shm_writer_client_pair_free);
    }
  else if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
    {
      goto out;
    }

  return TRUE;

out:
  shm_writer_close (data);

  /* No need to destroy the source when the writer is destroyed.
   * We're destroying it here */
  g_object_weak_unref (G_OBJECT (data),
      shm_writer_destroy_source, g_main_current_source ());
  return FALSE;
}
static void
nautilus_tree_view_drag_dest_dispose (GObject *object)
{
    NautilusTreeViewDragDest *dest;

    dest = NAUTILUS_TREE_VIEW_DRAG_DEST (object);

    if (dest->details->tree_view) {
        g_object_weak_unref (G_OBJECT (dest->details->tree_view),
                             tree_view_weak_notify,
                             dest);
    }

    remove_scroll_timeout (dest);

    G_OBJECT_CLASS (nautilus_tree_view_drag_dest_parent_class)->dispose (object);
}
예제 #17
0
static void fm_progress_display_destroy(FmProgressDisplay* data)
{
    g_signal_handlers_disconnect_by_func(data->job, on_cancelled, data);

    fm_job_cancel(FM_JOB(data->job));
    if (data->suspended)
        fm_job_resume(FM_JOB(data->job));

    g_signal_handlers_disconnect_by_func(data->job, on_ask, data);
    g_signal_handlers_disconnect_by_func(data->job, on_ask_rename, data);
    g_signal_handlers_disconnect_by_func(data->job, on_error, data);
    g_signal_handlers_disconnect_by_func(data->job, on_prepared, data);
    g_signal_handlers_disconnect_by_func(data->job, on_cur_file, data);
    g_signal_handlers_disconnect_by_func(data->job, on_percent, data);
    g_signal_handlers_disconnect_by_func(data->job, on_finished, data);

    g_object_unref(data->job);

    if(data->timer)
        g_timer_destroy(data->timer);

    if(data->parent)
        g_object_unref(data->parent);

    g_free(data->cur_file);
    g_free(data->old_cur_file);

    if(data->delay_timeout)
        g_source_remove(data->delay_timeout);

    if(data->update_timeout)
        g_source_remove(data->update_timeout);

    if(data->dlg)
    {
        g_object_weak_unref(G_OBJECT(data->dlg), on_progress_dialog_destroy, data);
        g_object_unref(data->error_buf);
        g_object_unref(data->bold_tag);
        gtk_widget_destroy(GTK_WIDGET(data->dlg));
    }

    if (data->str)
        g_string_free(data->str, TRUE);

    g_slice_free(FmProgressDisplay, data);
}
static void
gss_transaction_finished (SoupMessage * msg, GssTransaction * t)
{
  t->total_time += g_get_real_time ();

  gss_log_transaction (t);
  if (t->sync_process_time > 1000) {
    char *uri;
    uri = soup_uri_to_string (soup_message_get_uri (t->msg), TRUE);
    GST_WARNING ("synchronous processing too slow: %" G_GUINT64_FORMAT
        " us, \"%s\"", t->sync_process_time, uri);
    g_free (uri);
  }
  g_object_weak_unref (G_OBJECT (t->msg),
      (GWeakNotify) (gss_transaction_finalize), t);
  gss_transaction_free (t);
}
예제 #19
0
static void
egg_state_property_free (gpointer data)
{
  EggStateProperty *prop = data;

  if (prop->object != NULL)
    {
      g_object_weak_unref (prop->object,
                           egg_state_machine__property_object_weak_notify,
                           prop);
      prop->object = NULL;
    }

  g_free (prop->property);
  g_value_unset (&prop->value);
  g_slice_free (EggStateProperty, prop);
}
예제 #20
0
static void
disconnect_all_signals ()
{
	GSList * item = connected_widgets;
	while (item != NULL)
	{
		SignalInfo *signal_info = (SignalInfo*) item->data;
		
		g_signal_handler_disconnect (signal_info->widget, signal_info->handler_id);
		g_object_weak_unref (G_OBJECT (signal_info->widget), on_connected_widget_destruction, signal_info);
		g_free (signal_info);
		
		item = g_slist_next (item);
	}
	
	g_slist_free (connected_widgets);
	connected_widgets = NULL;
}
예제 #21
0
gboolean
atk_relation_remove_target (AtkRelation *relation,
                            AtkObject *target)
{
  gboolean ret = FALSE;
  GPtrArray *array;

  array = atk_relation_get_target (relation);

  if (array && g_ptr_array_remove (array, target))
    {
      g_object_weak_unref (G_OBJECT (target),
                           (GWeakNotify) delete_object_while_in_relation,
                           relation->target);
      ret = TRUE;
    }
  return ret;
}
예제 #22
0
/* Properly destroy an ObjRef as it's freed from the hash table */
static void
wref_free_func (gpointer p)
{
	ObjRef *ref = p;
	GObject *obj = g_weak_ref_get (&ref->ref);

	if (obj) {
		/* The object is being removed from the bag while it's
		 * still alive, e.g. by camel_object_bag_remove()
		 * or camel_object_bag_destroy(). Drop the weak_ref. */
		g_object_weak_unref (
			obj, (GWeakNotify) object_bag_notify,
			ref->bag);
		g_object_unref (obj);
	}
	g_weak_ref_clear (&ref->ref);
	g_slice_free (ObjRef, ref);
}
예제 #23
0
static void
gst_validate_monitor_dispose (GObject * object)
{
  GstValidateMonitor *monitor = GST_VALIDATE_MONITOR_CAST (object);

  g_mutex_clear (&monitor->mutex);
  g_mutex_clear (&monitor->overrides_mutex);
  g_queue_clear (&monitor->overrides);

  if (monitor->target)
    g_object_weak_unref (G_OBJECT (monitor->target),
        (GWeakNotify) _target_freed_cb, monitor);

  if (monitor->media_descriptor)
    gst_object_unref (monitor->media_descriptor);

  G_OBJECT_CLASS (parent_class)->dispose (object);
}
예제 #24
0
    void clear()
    {
        if (m_objects.isEmpty())
            return;

        auto objects = WTFMove(m_objects);

        // Deleting of DOM wrappers might end up deleting the wrapped core object which could cause some problems
        // for example if a Document is deleted during the frame destruction, so we remove the weak references now
        // and delete the objects on next run loop iteration. See https://bugs.webkit.org/show_bug.cgi?id=151700.
        for (auto* data : objects)
            g_object_weak_unref(data->object, DOMObjectCacheFrameObserver::objectFinalizedCallback, this);

        RunLoop::main().dispatch([objects] {
            for (auto* data : objects)
                data->clearObject();
        });
    }
예제 #25
0
static void
dispose (GObject *object)
{
	E2kUserDialog *dialog = E2K_USER_DIALOG (object);

	if (dialog->priv->name_selector != NULL) {
		g_object_unref (dialog->priv->name_selector);
		dialog->priv->name_selector = NULL;
	}

	if (dialog->priv->parent_window) {
		g_object_weak_unref (G_OBJECT (dialog->priv->parent_window),
				     parent_window_destroyed, dialog);
		dialog->priv->parent_window = NULL;
	}

	G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
xfdesktop_clipboard_manager_transfer_files (XfdesktopClipboardManager *manager,
                                            gboolean                copy,
                                            GList                  *files)
{
  XfdesktopFileIcon *file;
  GList      *lp;

  /* release any pending files */
  for (lp = manager->files; lp != NULL; lp = lp->next)
    {
      g_object_weak_unref(G_OBJECT (lp->data),
                          (GWeakNotify)xfdesktop_clipboard_manager_file_destroyed,
                          manager);
      g_object_unref (G_OBJECT (lp->data));
    }
  g_list_free (manager->files);

  /* remember the transfer operation */
  manager->files_cutted = !copy;

  /* setup the new file list */
  for (lp = files, manager->files = NULL; lp != NULL; lp = lp->next)
    {
      file = g_object_ref (G_OBJECT (lp->data));
      manager->files = g_list_prepend (manager->files, file);
      g_object_weak_ref(G_OBJECT(file), 
                        (GWeakNotify)xfdesktop_clipboard_manager_file_destroyed,
                        manager);
    }

  /* acquire the CLIPBOARD ownership */
  gtk_clipboard_set_with_owner (manager->clipboard, clipboard_targets,
                                G_N_ELEMENTS (clipboard_targets),
                                xfdesktop_clipboard_manager_get_callback,
                                xfdesktop_clipboard_manager_clear_callback,
                                G_OBJECT (manager));

  /* Need to fake a "owner-change" event here if the Xserver doesn't support clipboard notification */
  if (!gdk_display_supports_selection_notification (gtk_clipboard_get_display (manager->clipboard)))
    {
      xfdesktop_clipboard_manager_owner_changed (manager->clipboard, NULL, manager);
    }
}
예제 #27
0
static void
gail_focus_tracker (AtkObject *focus_object)
{
  /*
   * Do not report focus on redundant object
   */
  if (focus_object && 
      (atk_object_get_role(focus_object) != ATK_ROLE_REDUNDANT_OBJECT))
    {
      AtkObject *old_focus_object;

      if (!GTK_IS_ACCESSIBLE (focus_object))
        {
          AtkObject *parent;

          parent = focus_object;
          while (1)
            {
              parent = atk_object_get_parent (parent);
              if (parent == NULL)
                break;
              if (GTK_IS_ACCESSIBLE (parent))
                break;
            }

          if (parent)
            {
              gail_set_focus_object (focus_object, parent);
            }
        }
      else
        {
          old_focus_object = g_object_get_qdata (G_OBJECT (focus_object), quark_focus_object);
          if (old_focus_object)
            {
              g_object_weak_unref (G_OBJECT (old_focus_object),
                                   (GWeakNotify) gail_focus_object_destroyed,
                                   focus_object);
              g_object_set_qdata (G_OBJECT (focus_object), quark_focus_object, NULL);
              g_object_unref (G_OBJECT (focus_object));
            }
        }
    }
}
예제 #28
0
static void
eti_dispose (GObject *object)
{
	GalA11yETableItem *a11y = GAL_A11Y_E_TABLE_ITEM (object);
	GalA11yETableItemPrivate *priv = GET_PRIVATE (a11y);

	if (priv->columns) {
		free_columns (priv->columns);
		priv->columns = NULL;
	}

	if (priv->item) {
		g_object_weak_unref (G_OBJECT (priv->item), item_finalized, a11y);
		priv->item = NULL;
	}

	if (parent_class->dispose)
		parent_class->dispose (object);
}
예제 #29
0
/**
 * gnm_stf_export_options_sheet_list_clear:
 * @stfe: an export options struct
 *
 * Clears the sheet list.
 **/
void
gnm_stf_export_options_sheet_list_clear (GnmStfExport *stfe)
{
	GSList *l;

	g_return_if_fail (GNM_IS_STF_EXPORT (stfe));


	for (l = stfe->sheet_list; l; l = l->next) {
		Sheet *sheet = l->data;

		g_object_weak_unref (G_OBJECT (sheet),
				     (GWeakNotify) cb_sheet_destroyed,
				     stfe);
	}

	g_slist_free (stfe->sheet_list);
	stfe->sheet_list = NULL;
}
static void
nautilus_progress_info_manager_finalize (GObject *obj)
{
    GList *l;
    NautilusProgressInfoManager *self = NAUTILUS_PROGRESS_INFO_MANAGER (obj);

    if (self->progress_infos != NULL)
    {
        g_list_free_full (self->progress_infos, g_object_unref);
    }

    for (l = self->current_viewers; l != NULL; l = l->next)
    {
        g_object_weak_unref (l->data, (GWeakNotify) remove_viewer, self);
    }
    g_list_free (self->current_viewers);

    G_OBJECT_CLASS (nautilus_progress_info_manager_parent_class)->finalize (obj);
}