Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-application.c14
-rw-r--r--shell/ev-application.h1
-rw-r--r--shell/main.c12
3 files changed, 21 insertions, 6 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c
index de5e3a0..ffa58ee 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -46,20 +46,22 @@
G_DEFINE_TYPE (EvApplication, ev_application, G_TYPE_OBJECT);
-#define EV_APPLICATION_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_APPLICATION, EvApplicationPrivate))
-
#define APPLICATION_SERVICE_NAME "org.gnome.evince.ApplicationService"
#ifdef ENABLE_DBUS
gboolean
ev_application_register_service (EvApplication *application)
{
- DBusGConnection *connection;
+ static DBusGConnection *connection = NULL;
DBusGProxy *driver_proxy;
GError *err = NULL;
guint request_name_result;
+ if (connection) {
+ g_warning ("Service already registered.");
+ return FALSE;
+ }
+
connection = dbus_g_bus_get (DBUS_BUS_STARTER, &err);
if (connection == NULL) {
g_warning ("Service registration failed.");
@@ -90,6 +92,8 @@ ev_application_register_service (EvApplication *application)
}
#endif
+ g_object_unref (driver_proxy);
+
if (request_name_result == DBUS_REQUEST_NAME_REPLY_EXISTS) {
return FALSE;
}
@@ -325,7 +329,7 @@ ev_application_shutdown (EvApplication *application)
g_object_unref (application->recent_model);
application->recent_model = NULL;
}
-
+
g_free (application->last_chooser_uri);
g_object_unref (application);
diff --git a/shell/ev-application.h b/shell/ev-application.h
index 2202a9a..0c562c0 100644
--- a/shell/ev-application.h
+++ b/shell/ev-application.h
@@ -35,7 +35,6 @@ G_BEGIN_DECLS
typedef struct _EvApplication EvApplication;
typedef struct _EvApplicationClass EvApplicationClass;
-typedef struct _EvApplicationPrivate EvApplicationPrivate;
#define EV_TYPE_APPLICATION (ev_application_get_type ())
#define EV_APPLICATION(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_APPLICATION, EvApplication))
diff --git a/shell/main.c b/shell/main.c
index 3a38986..91a62d2 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -158,6 +158,8 @@ load_files_remote (const char **files)
if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) {
g_warning (error->message);
g_clear_error (&error);
+ g_object_unref (remote_object);
+ dbus_g_connection_unref (connection);
return FALSE;
}
#elif DBUS_VERSION == 34
@@ -168,6 +170,8 @@ load_files_remote (const char **files)
if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) {
g_warning (error->message);
g_clear_error (&error);
+ g_object_unref (remote_object);
+ dbus_g_connection_unref (connection);
return FALSE;
}
#else
@@ -177,9 +181,14 @@ load_files_remote (const char **files)
G_TYPE_INVALID)) {
g_warning (error->message);
g_clear_error (&error);
+ g_object_unref (remote_object);
+ dbus_g_connection_unref (connection);
return FALSE;
}
#endif
+ g_object_unref (remote_object);
+ dbus_g_connection_unref (connection);
+
return TRUE;
}
@@ -232,6 +241,9 @@ load_files_remote (const char **files)
result = TRUE;
}
+ g_object_unref (remote_object);
+ dbus_g_connection_unref (connection);
+
gdk_notify_startup_complete ();
return result;