コード例 #1
0
ファイル: dbus.c プロジェクト: SayCV/geda-pcb
/*!
 * \brief Carry out all actions to finalise the D-Bus connection.
 */
void
pcb_dbus_finish (void)
{
  DBusError err;

  // Initialise the error variable
  dbus_error_init (&err);

  // TODO: Could emit a "goodbye" signal here?

  dbus_connection_flush (pcb_dbus_conn);

  dbus_connection_unregister_object_path (pcb_dbus_conn,
					  PCB_DBUS_OBJECT_PATH);

  dbus_bus_release_name (pcb_dbus_conn, PCB_DBUS_CANONICAL_NAME, &err);

  dbus_error_free (&err);

  pcb_dbus_connection_finish_with_mainloop (pcb_dbus_conn);

  dbus_connection_close (pcb_dbus_conn);
  dbus_connection_unref (pcb_dbus_conn);

  // Call DBus shutdown. This doesn't work with shared connections,
  // only private ones (like we took out earlier).
  // If any future module / plugin to PCB wants to use DBus too,
  // we must remove this call. DBus will get shut-down when the app exits.
  dbus_shutdown ();
}
コード例 #2
0
void pcb_dbus_finish( void )
{
  DBusError err;
  dbus_error_init( err.name );
  dbus_connection_flush( &pcb_dbus_conn );
  dbus_connection_unregister_object_path( &pcb_dbus_conn, "/org/seul/geda/pcb" );
  dbus_bus_release_name( &pcb_dbus_conn, "org.seul.geda.pcb", err.name );
  dbus_error_free( err.name );
  pcb_dbus_connection_finish_with_mainloop( &pcb_dbus_conn );
  dbus_connection_close( &pcb_dbus_conn );
  dbus_connection_unref( &pcb_dbus_conn );
  dbus_shutdown( );
  return;
}