comparison src/plugins.c @ 981:7e231bc0018a

[gaim-migrate @ 991] I think I need a Pepsi. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 13 Oct 2000 07:24:40 +0000
parents 9eb07b383df4
children 91b7377e7b45
comparison
equal deleted inserted replaced
980:82c5865f7cfe 981:7e231bc0018a
406 (*gaim_plugin_remove)(); 406 (*gaim_plugin_remove)();
407 407
408 gaim_plugin_unload(p->handle); 408 gaim_plugin_unload(p->handle);
409 } 409 }
410 410
411 static void remove_callback(struct gaim_plugin *p) {
412 gtk_timeout_remove(p->remove);
413 dlclose(p->handle);
414 g_free(p);
415 }
416
417 /* gaim_plugin_unload serves 2 purposes: 1. so plugins can unload themselves 411 /* gaim_plugin_unload serves 2 purposes: 1. so plugins can unload themselves
418 * 2. to make my life easier */ 412 * 2. to make my life easier */
419 void gaim_plugin_unload(void *handle) { 413 void gaim_plugin_unload(void *handle) {
420 GList *i; 414 GList *i;
421 struct gaim_plugin *p = NULL; 415 struct gaim_plugin *p = NULL;
454 } 448 }
455 } else { 449 } else {
456 c = g_list_next(c); 450 c = g_list_next(c);
457 } 451 }
458 } 452 }
459 /* remove callbacks later (this will g_free p) */
460 p->remove = gtk_timeout_add(5000, (GtkFunction)remove_callback, p);
461 453
462 plugins = g_list_remove(plugins, p); 454 plugins = g_list_remove(plugins, p);
463 g_free(p->filename); 455 g_free(p->filename);
456 /* we don't dlclose(p->handle) in case if we still need code from the plugin later */
457 g_free(p);
464 if (config) gtk_widget_set_sensitive(config, 0); 458 if (config) gtk_widget_set_sensitive(config, 0);
465 update_show_plugins(); 459 update_show_plugins();
466 save_prefs(); 460 save_prefs();
467 } 461 }
468 462
502 confighandle = 0; 496 confighandle = 0;
503 } 497 }
504 498
505 void gaim_signal_connect(void *handle, enum gaim_event which, 499 void gaim_signal_connect(void *handle, enum gaim_event which,
506 void *func, void *data) { 500 void *func, void *data) {
507 struct gaim_callback *call = g_malloc(sizeof *call); 501 struct gaim_callback *call = g_new0(struct gaim_callback, 1);
508 call->handle = handle; 502 call->handle = handle;
509 call->event = which; 503 call->event = which;
510 call->function = func; 504 call->function = func;
511 call->data = data; 505 call->data = data;
512 506