Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: timvideos/gst-switch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7009b130b2b7
Choose a base ref
...
head repository: timvideos/gst-switch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4d7331621db4
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Jan 6, 2015

  1. Copy the full SHA
    81390fc View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    346a73e View commit details

Commits on Jan 7, 2015

  1. Merge pull request #89 from mithro/g_error_free

    Fixing g_error usage in gstswitchcontroller.c
    mithro committed Jan 7, 2015
    Copy the full SHA
    4d73316 View commit details
Showing with 20 additions and 29 deletions.
  1. +20 −29 tools/gstswitchcontroller.c
49 changes: 20 additions & 29 deletions tools/gstswitchcontroller.c
Original file line number Diff line number Diff line change
@@ -298,6 +298,7 @@ gst_switch_controller_emit_ui_signal (GstSwitchController * controller,
signame, parameters, &error);

if (!res) {
g_assert (error != NULL);
ERROR ("emit: (%d) %s", num, error->message);
} else {
++num;
@@ -325,16 +326,16 @@ gst_switch_controller_on_connection_closed (GDBusConnection * connection,

if (error) {
WARN ("close: %s", error->message);
g_error_free (error);
}

g_object_unref (connection);
GST_SWITCH_CONTROLLER_LOCK_UIS (controller);
controller->uis = g_list_remove (controller->uis, connection);
GST_SWITCH_CONTROLLER_UNLOCK_UIS (controller);

INFO ("closed: %p, %d (%d uis)", connection, vanished,
g_list_length (controller->uis));

g_object_unref (connection);
}

static GVariant *gst_switch_controller_call_client (GstSwitchController *
@@ -413,17 +414,18 @@ gst_switch_controller_on_new_connection (GDBusServer * server,
NULL, /* user_data_free_func */
&error);

if (register_id <= 0 || error != NULL) {
if (error != NULL) {
ERROR ("failed to register controller: %s", error->message);
return TRUE;
g_error_free (error);
return FALSE;
} else if (register_id <= 0) {
ERROR ("register_id invalid (<= 0): %d", register_id);
return FALSE;
} else {
INFO ("registered: %d, %s, %s", register_id,
SWITCH_CONTROLLER_OBJECT_PATH, introspection_data->interfaces[0]->name);
}

/*
INFO ("registered: %d, %s, %s", register_id,
SWITCH_CONTROLLER_OBJECT_PATH,
introspection_data->interfaces[0]->name);
*/

g_signal_connect (connection, "closed",
G_CALLBACK (gst_switch_controller_on_connection_closed), controller);

@@ -474,12 +476,13 @@ gst_switch_controller_init (GstSwitchController * controller)
auth_observer = g_dbus_auth_observer_new ();
controller->bus_server = g_dbus_server_new_sync (SWITCH_CONTROLLER_ADDRESS, flags, guid, auth_observer, NULL, /* GCancellable */
&error);
if (error != NULL) {
g_error ("failed to register controller: %s", error->message);
}
g_assert (controller->bus_server != NULL);

g_free (guid);

if (controller->bus_server == NULL)
goto error_new_server;

INFO ("Controller is listening at: %s",
g_dbus_server_get_client_address (controller->bus_server));

@@ -496,14 +499,6 @@ gst_switch_controller_init (GstSwitchController * controller)

// TODO: singleton object
return;

/* Errors Handling */
error_new_server:
{
if (error)
ERROR ("%s", error->message);
return;
}
}

/**
@@ -580,20 +575,16 @@ gst_switch_controller_call_client (GstSwitchController * controller,
NULL /* TODO: cancellable */ ,
&error);

if (error != NULL)
goto error_call_sync;

return value;

/* ERRORS */
error_call_sync:
{
if (error != NULL) {
ERROR ("%s (%s)", error->message, method_name);
g_error_free (error);
if (value)
g_variant_unref (value);
return NULL;
}
g_assert (value != NULL);

return value;
}

/**