# HG changeset patch # User Mark Doliner # Date 1058090104 0 # Node ID 38410dac4ac274650214f32431c2bdc651970c9e # Parent 99f4bbeb27bcf0fb4bc85cfb3b12d87f244e4e48 [gaim-migrate @ 6568] Fix Cae Non-Fatal Bad Bug 3: "unloading the remote control plugin makes the cpu run at 99% and stay there" Here comes the sun... committer: Tailor Script diff -r 99f4bbeb27bc -r 38410dac4ac2 plugins/gaim-remote/remote.c --- a/plugins/gaim-remote/remote.c Sun Jul 13 09:34:48 2003 +0000 +++ b/plugins/gaim-remote/remote.c Sun Jul 13 09:55:04 2003 +0000 @@ -51,6 +51,7 @@ #ifndef _WIN32 static gint UI_fd = -1; +static guint watcher = 0; #endif static int gaim_session = 0; static GSList *uis = NULL; @@ -676,7 +677,7 @@ return 1; channel = g_io_channel_unix_new(UI_fd); - g_io_add_watch(channel, G_IO_IN, socket_readable, NULL); + watcher = g_io_add_watch(channel, G_IO_IN, socket_readable, NULL); g_io_channel_unref(channel); #endif @@ -694,6 +695,7 @@ /* don't save prefs after plugins are gone... */ #ifndef _WIN32 char buf[1024]; + g_source_remove(watcher); close(UI_fd); g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S "gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), gaim_session);