Author: ek.kato
Date: Wed Jan 14 21:05:43 2009
New Revision: 5714

Modified:
   trunk/helper/dict-main-gtk.c
   trunk/uim/uim-helper-client.c

Log:
* uim/uim-helper-client.c (uim_helper_close_client_fd) : Again,
  plug leak.
* helper/dict-main-gtk.c : Remove meaningless and harmful code
  about uim-helper connection.


Modified: trunk/helper/dict-main-gtk.c
==============================================================================
--- trunk/helper/dict-main-gtk.c        (original)
+++ trunk/helper/dict-main-gtk.c        Wed Jan 14 21:05:43 2009
@@ -50,7 +50,6 @@
 #include "dict-word-list-view-gtk.h"

 static unsigned int read_tag;
-static int uim_fd;  /* file descriptor to connect helper message bus */
 static int ae_mode; /* add mode or edit mode */
 static int g_startup_dictionary;

@@ -60,43 +59,6 @@
   NR_MODE
 };

-static void
-helper_disconnect_cb(void)
-{
-  uim_fd = -1;
-  g_source_remove(read_tag);
-}
-
-static gboolean
-fd_read_cb(GIOChannel *channel, GIOCondition c, gpointer p)
-{
-  char *tmp;
-  int fd = g_io_channel_unix_get_fd(channel);
-
-  uim_helper_read_proc(fd);
-  while ((tmp = uim_helper_get_message())) {
-    /* parse_helper_str(tmp); */
-    g_free(tmp);
-    tmp = NULL;
-  }
-  return TRUE;
-}
-
-static void
-check_helper_connection(void)
-{
-  if (uim_fd < 0) {
-    uim_fd = uim_helper_init_client_fd(helper_disconnect_cb);
-    if (uim_fd > 0) {
-      GIOChannel *channel;
-      channel = g_io_channel_unix_new(uim_fd);
-      read_tag = g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR,
-                               fd_read_cb, NULL);
-      g_io_channel_unref(channel);
-    }
-  }
-}
-
 static char *
 get_error_msg(void)
 {
@@ -274,10 +236,6 @@
     g_printerr(_("Error:%s\n"), get_error_msg());
     exit(EXIT_FAILURE);
   }
-
-  /* connect to uim helper message bus */
-  uim_fd = -1;
-  check_helper_connection();

   gtk_main ();


Modified: trunk/uim/uim-helper-client.c
==============================================================================
--- trunk/uim/uim-helper-client.c       (original)
+++ trunk/uim/uim-helper-client.c       Wed Jan 14 21:05:43 2009
@@ -153,6 +153,8 @@
   if (uim_disconnect_cb)
     uim_disconnect_cb();

+  free(uim_read_buf);
+  uim_read_buf = NULL;
   uim_fd = -1;
 }

Reply via email to