Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evince/ChangeLog,v retrieving revision 1.817 diff -u -u -r1.817 ChangeLog --- ChangeLog 9 May 2006 08:17:51 -0000 1.817 +++ ChangeLog 9 May 2006 17:39:44 -0000 @@ -1,3 +1,11 @@ +2006-05-09 Carlos Garcia Campos + + * pdf/ev-poppler.cc: + * shell/ev-application.[ch]: + * shell/main.c: + + Fix some memory leaks. + 2006-05-09 Wouter Bolsterlee * shell/ev-properties-dialog.c: (ev_properties_dialog_init): Index: pdf/ev-poppler.cc =================================================================== RCS file: /cvs/gnome/evince/pdf/ev-poppler.cc,v retrieving revision 1.68 diff -u -u -r1.68 ev-poppler.cc --- pdf/ev-poppler.cc 4 May 2006 08:24:18 -0000 1.68 +++ pdf/ev-poppler.cc 9 May 2006 17:39:44 -0000 @@ -964,6 +964,7 @@ if (child) build_tree (pdf_document, model, &tree_iter, child); poppler_index_iter_free (child); + poppler_action_free (action); } while (poppler_index_iter_next (iter)); } Index: shell/ev-application.c =================================================================== RCS file: /cvs/gnome/evince/shell/ev-application.c,v retrieving revision 1.32 diff -u -u -r1.32 ev-application.c --- shell/ev-application.c 2 May 2006 19:02:46 -0000 1.32 +++ shell/ev-application.c 9 May 2006 17:39:44 -0000 @@ -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 @@ } #endif + g_object_unref (driver_proxy); + if (request_name_result == DBUS_REQUEST_NAME_REPLY_EXISTS) { return FALSE; } @@ -325,7 +329,7 @@ g_object_unref (application->recent_model); application->recent_model = NULL; } - + g_free (application->last_chooser_uri); g_object_unref (application); Index: shell/ev-application.h =================================================================== RCS file: /cvs/gnome/evince/shell/ev-application.h,v retrieving revision 1.14 diff -u -u -r1.14 ev-application.h --- shell/ev-application.h 2 May 2006 19:02:46 -0000 1.14 +++ shell/ev-application.h 9 May 2006 17:39:44 -0000 @@ -35,7 +35,6 @@ 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)) Index: shell/main.c =================================================================== RCS file: /cvs/gnome/evince/shell/main.c,v retrieving revision 1.30 diff -u -u -r1.30 main.c --- shell/main.c 2 May 2006 19:02:46 -0000 1.30 +++ shell/main.c 9 May 2006 17:39:44 -0000 @@ -158,6 +158,8 @@ 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 @@ 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 @@ 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; } @@ -231,6 +240,9 @@ g_free (uri); result = TRUE; } + + g_object_unref (remote_object); + dbus_g_connection_unref (connection); gdk_notify_startup_complete ();