Identified two more entry points
authorPhilip Chimento <philip.chimento@gmail.com>
Wed, 1 Feb 2012 21:06:05 +0000 (22:06 +0100)
committerPhilip Chimento <philip.chimento@gmail.com>
Wed, 1 Feb 2012 21:06:05 +0000 (22:06 +0100)
This fixes an obscure bug! If you create your ChimaraGlk object
not with chimara_glk_new() but with g_object_new(), then the library
init function was not called. That caused a crash when trying to
access the thread-private data.

libchimara/chimara-glk.c
libchimara/chimara-if.c

index b7c0a7d6f3df2f9290ed5e459ea02d9c481b9e26..925acd2e184d7444b9a88d7782a3437adc8cce0a 100644 (file)
@@ -170,6 +170,8 @@ G_DEFINE_TYPE(ChimaraGlk, chimara_glk, GTK_TYPE_CONTAINER);
 static void
 chimara_glk_init(ChimaraGlk *self)
 {
+       chimara_init(); /* This is a library entry point */
+
     gtk_widget_set_has_window(GTK_WIDGET(self), FALSE);
 
     ChimaraGlkPrivate *priv = CHIMARA_GLK_PRIVATE(self);
index ed132bb5f01d32e0e1c3080b7166e77440967de1..95f8b93dca03082d9fe9fd69d4dca18a4da6f279 100644 (file)
@@ -159,6 +159,8 @@ chimara_if_text_buffer_output(ChimaraGlk *glk, guint32 win_rock, gchar *output)
 static void
 chimara_if_init(ChimaraIF *self)
 {
+       chimara_init(); /* This is a library entry point */
+
        CHIMARA_IF_USE_PRIVATE(self, priv);
        priv->preferred_interpreter[CHIMARA_IF_FORMAT_Z5] = CHIMARA_IF_INTERPRETER_FROTZ;
        priv->preferred_interpreter[CHIMARA_IF_FORMAT_Z6] = CHIMARA_IF_INTERPRETER_NITFOL;