diff options
author | Alexander Larsson <alexl@redhat.com> | 2008-09-23 13:05:14 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2008-09-23 13:05:14 +0000 |
commit | f163407969caf032abe874ad086e2d08b16d2022 (patch) | |
tree | 6fec8582a82e7a960aa709071be27db1a5a83ff2 | |
parent | 08b39e1e79ba535afe4755158a4689ebf8412284 (diff) | |
download | gvfs-f163407969caf032abe874ad086e2d08b16d2022.tar.gz |
Link all modules against the installed libgvfscommon instead of
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=/branches/gnome-2-24/; revision=2019
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | client/Makefile.am | 2 | ||||
-rw-r--r-- | client/gdaemonvfs.c | 8 | ||||
-rw-r--r-- | common/Makefile.am | 8 | ||||
-rw-r--r-- | common/gmountsource.c | 25 | ||||
-rw-r--r-- | common/gmounttracker.c | 26 | ||||
-rw-r--r-- | monitor/gphoto2/Makefile.am | 2 | ||||
-rw-r--r-- | monitor/hal/Makefile.am | 2 | ||||
-rw-r--r-- | monitor/proxy/Makefile.am | 4 |
9 files changed, 39 insertions, 62 deletions
@@ -1,3 +1,27 @@ +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. + 2008-09-22 Alexander Larsson <alexl@redhat.com> * configure.ac: diff --git a/client/Makefile.am b/client/Makefile.am index 9d61e204..274d9fd3 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -39,7 +39,7 @@ vfssources = \ $(NULL) vfslibs = \ - $(top_builddir)/common/libgvfscommon-noin.la \ + $(top_builddir)/common/libgvfscommon.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(NULL) diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c index e4f9164a..7479bd82 100644 --- a/client/gdaemonvfs.c +++ b/client/gdaemonvfs.c @@ -983,6 +983,14 @@ g_io_module_load (GIOModule *module) if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL) return; + /* Make this module resident so that we ground the common + * library. If that is unloaded we could get into all kinds + * of strange situations. This is safe to do even if we loaded + * some other common-using module first as all modules are loaded + * before any are freed. + */ + g_type_module_use (G_TYPE_MODULE (module)); + g_daemon_vfs_register_type (G_TYPE_MODULE (module)); g_daemon_volume_monitor_register_types (G_TYPE_MODULE (module)); 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, diff --git a/monitor/gphoto2/Makefile.am b/monitor/gphoto2/Makefile.am index df37aa20..5137a65e 100644 --- a/monitor/gphoto2/Makefile.am +++ b/monitor/gphoto2/Makefile.am @@ -40,7 +40,7 @@ gvfs_gphoto2_volume_monitor_LDFLAGS = \ gvfs_gphoto2_volume_monitor_LDADD = \ $(GLIB_LIBS) \ $(HAL_LIBS) \ - $(top_builddir)/common/libgvfscommon-noin.la \ + $(top_builddir)/common/libgvfscommon.la \ $(top_builddir)/monitor/proxy/libgvfsproxyvolumemonitordaemon-noin.la \ $(NULL) diff --git a/monitor/hal/Makefile.am b/monitor/hal/Makefile.am index f9d9d7e5..9c3d1777 100644 --- a/monitor/hal/Makefile.am +++ b/monitor/hal/Makefile.am @@ -42,7 +42,7 @@ gvfs_hal_volume_monitor_LDFLAGS = \ gvfs_hal_volume_monitor_LDADD = \ $(GLIB_LIBS) \ $(HAL_LIBS) \ - $(top_builddir)/common/libgvfscommon-noin.la \ + $(top_builddir)/common/libgvfscommon.la \ $(top_builddir)/monitor/proxy/libgvfsproxyvolumemonitordaemon-noin.la \ $(NULL) diff --git a/monitor/proxy/Makefile.am b/monitor/proxy/Makefile.am index 6cb7a0e3..9f1c9743 100644 --- a/monitor/proxy/Makefile.am +++ b/monitor/proxy/Makefile.am @@ -33,7 +33,7 @@ libgioremote_volume_monitor_la_LDFLAGS = \ libgioremote_volume_monitor_la_LIBADD = \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ - $(top_builddir)/common/libgvfscommon-noin.la \ + $(top_builddir)/common/libgvfscommon.la \ $(NULL) ############################################################################ @@ -57,7 +57,7 @@ libgvfsproxyvolumemonitordaemon_noin_la_CFLAGS = \ libgvfsproxyvolumemonitordaemon_noin_la_LIBADD = \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ - $(top_builddir)/common/libgvfscommon-noin.la \ + $(top_builddir)/common/libgvfscommon.la \ $(NULL) clean-local: |