summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-09-23 19:16:06 +0000
committerAlexander Larsson <alexl@src.gnome.org>2008-09-23 19:16:06 +0000
commit0d1cff0829a4a1f4ce1095d9da694dcaaa74f024 (patch)
tree145acf6acb21ab39e0bc43deab47b365ec781156 /common
parentcc32fbdb7b1b52d7d28f31a4e967a99438ad68db (diff)
downloadgvfs-0d1cff0829a4a1f4ce1095d9da694dcaaa74f024.tar.gz
Only call the IsSupported dbus call when the class is actually needed
2008-09-23 Alexander Larsson <alexl@redhat.com> * monitor/proxy/gproxyvolumemonitor.[ch]: * monitor/proxy/gproxyvolumemonitor.h: * monitor/proxy/remote-volume-monitor-module.c: Only call the IsSupported dbus call when the class is actually needed instead of on gio init. Don't integrate internal session bus with mainloop during is_support code, as that is not necessary yet, and it caused problem if done in a thread. This fixes the trash crash issue in bug #547568. 2008-09-23 Alexander Larsson <alexl@redhat.com> * client/Makefile.am: * common/Makefile.am: * common/gmountsource.c: * common/gmounttracker.c: * monitor/gphoto2/Makefile.am: * monitor/hal/Makefile.am: * monitor/proxy/Makefile.am: Link all modules against the installed libgvfscommon instead of duplicating the statically linked one. This is safe wrt namespace conflicts, because the modules are opened RTLD_LOCAL so the dependencies will not pollute the global namespace. * client/gdaemonvfs.c: Make the gvfsdbus module persistant. This means we will never unload it, and thus not unload libgvfscommon which could be problematic. This is not a huge problem, as: + The gio modules will not be loaded anyway unless you use gio + The gvfsdbus module will be persistent anyway as soon as the app references the GVfs object, which likely all gio apps do + The module load order doesn't matter wrt unload order, because all gio modules are loaded before any one is unloaded. svn path=/trunk/; revision=2021
Diffstat (limited to 'common')
-rw-r--r--common/Makefile.am8
-rw-r--r--common/gmountsource.c25
-rw-r--r--common/gmounttracker.c26
3 files changed, 2 insertions, 57 deletions
diff --git a/common/Makefile.am b/common/Makefile.am
index 5c59496b..2fbb908b 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -1,6 +1,5 @@
NULL =
-noinst_LTLIBRARIES = libgvfscommon-noin.la
lib_LTLIBRARIES=libgvfscommon.la
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gvfs \
@@ -9,7 +8,7 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gvfs \
-DG_LOG_DOMAIN=\"GVFS\" -DG_DISABLE_DEPRECATED \
-DDBUS_API_SUBJECT_TO_CHANGE
-libgvfscommon_noin_la_SOURCES = \
+libgvfscommon_la_SOURCES = \
gsysutils.c gsysutils.h \
gdbusutils.c gdbusutils.h \
gmountspec.c gmountspec.h \
@@ -19,9 +18,6 @@ libgvfscommon_noin_la_SOURCES = \
gvfsdaemonprotocol.c gvfsdaemonprotocol.h \
$(NULL)
-libgvfscommon_noin_la_LIBADD = \
+libgvfscommon_la_LIBADD = \
$(DBUS_LIBS) \
$(GLIB_LIBS)
-
-libgvfscommon_la_SOURCES =
-libgvfscommon_la_LIBADD = libgvfscommon-noin.la
diff --git a/common/gmountsource.c b/common/gmountsource.c
index bbf6d73f..e801d647 100644
--- a/common/gmountsource.c
+++ b/common/gmountsource.c
@@ -35,32 +35,7 @@ struct _GMountSource
char *obj_path;
};
-/* We use this hack to avoid problems when this code
- is shared in both the daemon and the client */
-static GType _g_mount_source_get_type (void) G_GNUC_CONST;
-
-#define g_mount_source_get_type _g_mount_source_get_type
G_DEFINE_TYPE (GMountSource, g_mount_source, G_TYPE_OBJECT)
-#undef g_mount_source_get_type
-
-GType
-g_mount_source_get_type (void)
-{
- static volatile gsize type_volatile = 0;
-
- if (g_once_init_enter (&type_volatile))
- {
- GType type;
-
- type = g_type_from_name ("GMountSource");
- if (type == 0)
- type = _g_mount_source_get_type ();
-
- g_once_init_leave (&type_volatile, type);
- }
-
- return type_volatile;
-}
static void
g_mount_source_finalize (GObject *object)
diff --git a/common/gmounttracker.c b/common/gmounttracker.c
index 5d97d0c9..eba29ef5 100644
--- a/common/gmounttracker.c
+++ b/common/gmounttracker.c
@@ -54,33 +54,7 @@ struct _GMountTracker
DBusConnection *connection;
};
-/* We use this hack to avoid problems when this code
- is shared in both the daemon and the client */
-static GType _g_mount_tracker_get_type (void) G_GNUC_CONST;
-
-#define g_mount_tracker_get_type _g_mount_tracker_get_type
G_DEFINE_TYPE (GMountTracker, g_mount_tracker, G_TYPE_OBJECT)
-#undef g_mount_tracker_get_type
-
-GType
-g_mount_tracker_get_type (void)
-{
- static volatile gsize type_volatile = 0;
-
- if (g_once_init_enter (&type_volatile))
- {
- GType type;
-
- type = g_type_from_name ("GMountTracker");
- if (type == 0)
- type = _g_mount_tracker_get_type ();
-
- g_once_init_leave (&type_volatile, type);
- }
-
- return type_volatile;
-}
-
static DBusHandlerResult g_mount_tracker_filter_func (DBusConnection *conn,
DBusMessage *message,