[Galago-commits] r2933 - in trunk/libgalago: . libgalago
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Tue Oct 24 17:27:16 PDT 2006
Author: chipx86
Date: 2006-10-24 17:27:08 -0700 (Tue, 24 Oct 2006)
New Revision: 2933
Modified:
trunk/libgalago/ChangeLog
trunk/libgalago/configure.ac
trunk/libgalago/libgalago/Makefile.am
trunk/libgalago/libgalago/galago-core.c
trunk/libgalago/libgalago/galago-core.h
Log:
- Patch by Ross Burton to add galago_make_resident(), which is used to keep libgalago resident when being used in loadable modules. Closes ticket #93.
- Bump to version 0.5.2.90.
Modified: trunk/libgalago/ChangeLog
===================================================================
--- trunk/libgalago/ChangeLog 2006-10-16 20:13:29 UTC (rev 2932)
+++ trunk/libgalago/ChangeLog 2006-10-25 00:27:08 UTC (rev 2933)
@@ -1,3 +1,14 @@
+Tue Oct 24 17:24:46 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * libgalago/Makefile.am:
+ * libgalago/galago-core.c:
+ * libgalago/galago-core.h:
+ * configure.ac:
+ - Patch by Ross Burton to add galago_make_resident(), which is
+ used to keep libgalago resident when being used in loadable modules.
+ Closes ticket #93.
+ - Bump to version 0.5.2.90.
+
==================== 0.5.2 ====================
Sat Oct 07 11:53:37 EDT 2006 Christian Hammond <chipx86 at chipx86.com>
Modified: trunk/libgalago/configure.ac
===================================================================
--- trunk/libgalago/configure.ac 2006-10-16 20:13:29 UTC (rev 2932)
+++ trunk/libgalago/configure.ac 2006-10-25 00:27:08 UTC (rev 2933)
@@ -3,7 +3,7 @@
dnl ################################################################
dnl # Initialize autoconf
dnl ################################################################
-AC_INIT(libgalago, 0.5.2, chipx86 at chipx86.com)
+AC_INIT(libgalago, 0.5.2,90, chipx86 at chipx86.com)
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(config.h.in)
AC_CONFIG_MACRO_DIR([m4])
@@ -16,7 +16,7 @@
LIBGALAGO_MAJOR_VERSION=0
LIBGALAGO_MINOR_VERSION=5
LIBGALAGO_MICRO_VERSION=2
-LIBGALAGO_DEVEL_VERSION=0
+LIBGALAGO_DEVEL_VERSION=90
LIBGALAGO_VERSION=$LIBGALAGO_MAJOR_VERSION.$LIBGALAGO_MINOR_VERSION.$LIBGALAGO_MICRO_VERSION
@@ -94,7 +94,7 @@
AM_GNU_GETTEXT_VERSION(0.10.40)
AM_GNU_GETTEXT
-pkg_modules="glib-2.0 >= 2.8.0, dbus-1 >= 0.36, dbus-glib-1 >= 0.36"
+pkg_modules="glib-2.0 >= 2.8.0, gmodule-2.0, dbus-1 >= 0.36, dbus-glib-1 >= 0.36"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
Modified: trunk/libgalago/libgalago/Makefile.am
===================================================================
--- trunk/libgalago/libgalago/Makefile.am 2006-10-16 20:13:29 UTC (rev 2932)
+++ trunk/libgalago/libgalago/Makefile.am 2006-10-25 00:27:08 UTC (rev 2933)
@@ -99,6 +99,8 @@
INCLUDES = \
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"Galago\" \
+ -DLIBDIR="@libdir@" \
+ -DLIBVERSION="@LT_CURRENT@"
$(PACKAGE_CFLAGS)
EXTRA_DIST = \
Modified: trunk/libgalago/libgalago/galago-core.c
===================================================================
--- trunk/libgalago/libgalago/galago-core.c 2006-10-16 20:13:29 UTC (rev 2932)
+++ trunk/libgalago/libgalago/galago-core.c 2006-10-25 00:27:08 UTC (rev 2933)
@@ -28,6 +28,7 @@
#include <libgalago/galago-context.h>
#include <libgalago/galago-context-priv.h>
#include <libgalago/galago-marshal.h>
+#include <gmodule.h>
#include <string.h>
#ifdef HAVE_SIGNAL_H
@@ -936,6 +937,7 @@
G_LOCK(_core_lock);
_core = g_object_new(GALAGO_TYPE_CORE, NULL);
+ g_assert(_core);
_core->priv->init_ref_count = 1;
G_UNLOCK(_core_lock);
@@ -1749,3 +1751,27 @@
dbus_connection_send(galago_get_dbus_conn(), message, NULL);
dbus_message_unref(message);
}
+
+
+#define LIBRARY_FILE G_STRINGIFY(LIBDIR) "/libgalago.so." G_STRINGIFY(LIBVERSION)
+
+/*
+ * This function is a workaround for problems with libgalago getting loaded
+ * twice into the same process, such as when a plugin which uses libgalago after
+ * it has already been loaded and unloaded. In order to prevent
+ * g_type_register_static being called twice, this function can be called to
+ * make galago be resident in memory for the lifetime of the process.
+ */
+void
+galago_make_resident(void)
+{
+ GModule *module = g_module_open(LIBRARY_FILE, 0);
+
+ if (module == NULL)
+ {
+ g_critical("%s: g_module_open() failed: %s",
+ G_STRFUNC, g_module_error());
+ }
+
+ g_module_make_resident(module);
+}
Modified: trunk/libgalago/libgalago/galago-core.h
===================================================================
--- trunk/libgalago/libgalago/galago-core.h 2006-10-16 20:13:29 UTC (rev 2932)
+++ trunk/libgalago/libgalago/galago-core.h 2006-10-25 00:27:08 UTC (rev 2933)
@@ -125,6 +125,8 @@
GalagoCore *galago_get_core(void);
+void galago_make_resident(void);
+
G_END_DECLS
#endif /* _GALAGO_CORE_H_ */
More information about the galago-commits
mailing list