[tracker/tracker-0.6] Adapt tracker-extract to create all its resources before setting mem limits.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker/tracker-0.6] Adapt tracker-extract to create all its resources before setting mem limits.
- Date: Mon, 15 Jun 2009 08:28:14 -0400 (EDT)
commit ecbbd889c770084efcc37e0867f6ec6f1e66a5a1
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jun 15 14:24:28 2009 +0200
Adapt tracker-extract to create all its resources before setting mem limits.
src/tracker-extract/tracker-dbus.c | 11 ++---------
src/tracker-extract/tracker-dbus.h | 2 +-
src/tracker-extract/tracker-main.c | 11 ++++++-----
3 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/src/tracker-extract/tracker-dbus.c b/src/tracker-extract/tracker-dbus.c
index d895663..f71bfdd 100644
--- a/src/tracker-extract/tracker-dbus.c
+++ b/src/tracker-extract/tracker-dbus.c
@@ -153,22 +153,15 @@ tracker_dbus_shutdown (void)
}
gboolean
-tracker_dbus_register_objects (void)
+tracker_dbus_register_objects (gpointer object)
{
- gpointer object;
+ g_return_val_if_fail (TRACKER_IS_EXTRACT (object), FALSE);
if (!connection || !gproxy) {
g_critical ("DBus support must be initialized before registering objects!");
return FALSE;
}
- /* Add org.freedesktop.Tracker.Extract */
- object = tracker_extract_new ();
- if (!object) {
- g_critical ("Could not create TrackerExtract object to register");
- return FALSE;
- }
-
dbus_register_object (connection,
gproxy,
G_OBJECT (object),
diff --git a/src/tracker-extract/tracker-dbus.h b/src/tracker-extract/tracker-dbus.h
index db0d115..e56a4bf 100644
--- a/src/tracker-extract/tracker-dbus.h
+++ b/src/tracker-extract/tracker-dbus.h
@@ -30,7 +30,7 @@ G_BEGIN_DECLS
gboolean tracker_dbus_init (void);
void tracker_dbus_shutdown (void);
-gboolean tracker_dbus_register_objects (void);
+gboolean tracker_dbus_register_objects (gpointer object);
GObject *tracker_dbus_get_object (GType type);
G_END_DECLS
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 4f87545..056a599 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -264,6 +264,7 @@ main (int argc, char *argv[])
gchar *log_filename;
gboolean stand_alone = FALSE;
guint log_handler_id = 0;
+ TrackerExtract *object;
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -304,8 +305,6 @@ main (int argc, char *argv[])
initialize_signal_handler ();
- tracker_memory_setrlimits ();
-
g_type_init ();
if (!g_thread_supported ()) {
@@ -318,6 +317,10 @@ main (int argc, char *argv[])
setlocale (LC_ALL, "");
+ object = tracker_extract_new ();
+
+ tracker_memory_setrlimits ();
+
/* Set conditions when we use stand alone settings */
stand_alone |= filename != NULL;
@@ -337,11 +340,9 @@ main (int argc, char *argv[])
}
if (filename) {
- TrackerExtract *object;
GFile *file;
gchar *full_path;
- object = tracker_extract_new ();
if (!object) {
return EXIT_FAILURE;
}
@@ -384,7 +385,7 @@ main (int argc, char *argv[])
tracker_thumbnailer_init (config);
/* Make Tracker available for introspection */
- if (!tracker_dbus_register_objects ()) {
+ if (!tracker_dbus_register_objects (object)) {
g_free (log_filename);
g_object_unref (config);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]