-1

Cant please someone tell me why the code below crashes when executing, (compilation goes OK) it in rotated X environment 90 to left.

    DBusGConnection *connection;
    DBusGProxy *proxy;
    GError *error = NULL;
    gchar *name = NULL;

    g_type_init ();

    //Get the connection and ensure the name is not used yet
    connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
    if (connection == NULL) {
            g_warning ("Failed to make connection to system bus: %s",
                            error->message);
            g_error_free (error);
            exit(1);
    }

    proxy = dbus_g_proxy_new_for_name (connection,
                    "to.some.Service",
                    "/to/some/Object",
                    "to.some.Interface" );

    dbus_g_proxy_call(proxy, "getStatus", &error, G_TYPE_INVALID, G_TYPE_STRING, &name, G_TYPE_INVALID);
    printf("Name is: %s\n", name);
    return 0;
deimus
  • 9,565
  • 12
  • 63
  • 107
  • If it's really only crashing when the display is rotated 90 degrees, I'm pretty sure it's got something to do with the exact service you're calling. Please specify which service it is. – Matti Virkkunen Sep 19 '10 at 13:29
  • The service is defined by me and I think its working OK, because I've written a analogue python script (the same as above script) which returned correct values. – deimus Sep 19 '10 at 13:44
  • Actually above code is working OK at the first start of X. But fails to run normally if the display's orientation is rotated. – deimus Sep 19 '10 at 13:45
  • Downvoted as question is specific to your code and not generally useful to others. – Philip Withnall Jun 22 '17 at 10:41

1 Answers1

0

Got answer. Actually the service is running in Python and the returned value was not string ... as a consequence of not being strong types in python. So returning str(status) but no status solved my problem.

deimus
  • 9,565
  • 12
  • 63
  • 107