comparison src/module.c @ 2494:2c1950c5544a

[gaim-migrate @ 2507] don't ask committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 12 Oct 2001 22:31:12 +0000
parents 7f36b34f8676
children a83b4a5ffcd6
comparison
equal deleted inserted replaced
2493:1b7a1133962d 2494:2c1950c5544a
172 return FALSE; 172 return FALSE;
173 } 173 }
174 174
175 void gaim_plugin_unload(GModule *handle) 175 void gaim_plugin_unload(GModule *handle)
176 { 176 {
177 GList *pl = plugins;
178 struct gaim_plugin *p;
179 void (*gaim_plugin_remove)();
180
181 while (pl) {
182 p = pl->data;
183 if (p->handle == handle)
184 break;
185 pl = pl->next;
186 }
187 if (!pl)
188 return;
189
190 debug_printf("Unloading %s\n", g_module_name(p->handle));
191
192 if (g_module_symbol(p->handle, "gaim_plugin_remove", (gpointer *)&gaim_plugin_remove))
193 (*gaim_plugin_remove)();
194 plugin_remove_callbacks(p->handle);
195 plugins = g_list_remove(plugins, p);
196 g_free(p);
197 /* XXX CUI need to tell UI what happened, but not like this */
198 update_show_plugins();
199
177 g_timeout_add(5000, unload_timeout, handle); 200 g_timeout_add(5000, unload_timeout, handle);
178 } 201 }
179 202
180 /* Do unload/load cycle of plugin. */ 203 /* Do unload/load cycle of plugin. */
181 struct gaim_plugin *reload_plugin(struct gaim_plugin *p) 204 struct gaim_plugin *reload_plugin(struct gaim_plugin *p)