Mercurial > pidgin
comparison src/plugin.c @ 14035:8bda65b88e49
[gaim-migrate @ 16638]
A bunch of small changes. Mostly remove "if not null" checks before
calling g_free, g_list_free, g_slist_free and g_strdup. Also use
g_list_foreach() to call g_free to free strings in an array. And
some whitespace changes here and there.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 05 Aug 2006 08:27:39 +0000 |
parents | b43aec5fa9eb |
children | 7f0e6b3f4832 |
comparison
equal
deleted
inserted
replaced
14034:0839a7b71325 | 14035:8bda65b88e49 |
---|---|
188 GaimPlugin *plugin; | 188 GaimPlugin *plugin; |
189 | 189 |
190 plugin = g_new0(GaimPlugin, 1); | 190 plugin = g_new0(GaimPlugin, 1); |
191 | 191 |
192 plugin->native_plugin = native; | 192 plugin->native_plugin = native; |
193 plugin->path = (path == NULL ? NULL : g_strdup(path)); | 193 plugin->path = g_strdup(path); |
194 | 194 |
195 GAIM_DBUS_REGISTER_POINTER(plugin, GaimPlugin); | 195 GAIM_DBUS_REGISTER_POINTER(plugin, GaimPlugin); |
196 | 196 |
197 return plugin; | 197 return plugin; |
198 } | 198 } |
526 | 526 |
527 gaim_notify_error(NULL, NULL, | 527 gaim_notify_error(NULL, NULL, |
528 _("Gaim encountered errors loading the plugin."), tmp); | 528 _("Gaim encountered errors loading the plugin."), tmp); |
529 g_free(tmp); | 529 g_free(tmp); |
530 | 530 |
531 if (dep_list != NULL) | 531 g_list_free(dep_list); |
532 g_list_free(dep_list); | |
533 | 532 |
534 return FALSE; | 533 return FALSE; |
535 } | 534 } |
536 | 535 |
537 dep_list = g_list_append(dep_list, dep_plugin); | 536 dep_list = g_list_append(dep_list, dep_plugin); |
553 | 552 |
554 gaim_notify_error(NULL, NULL, | 553 gaim_notify_error(NULL, NULL, |
555 _("Gaim was unable to load your plugin."), tmp); | 554 _("Gaim was unable to load your plugin."), tmp); |
556 g_free(tmp); | 555 g_free(tmp); |
557 | 556 |
558 if (dep_list != NULL) | 557 g_list_free(dep_list); |
559 g_list_free(dep_list); | |
560 | 558 |
561 return FALSE; | 559 return FALSE; |
562 } | 560 } |
563 } | 561 } |
564 } | 562 } |
569 { | 567 { |
570 GaimPlugin *dep_plugin = (GaimPlugin *)l->data; | 568 GaimPlugin *dep_plugin = (GaimPlugin *)l->data; |
571 dep_plugin->dependent_plugins = g_list_prepend(dep_plugin->dependent_plugins, plugin->info->id); | 569 dep_plugin->dependent_plugins = g_list_prepend(dep_plugin->dependent_plugins, plugin->info->id); |
572 } | 570 } |
573 | 571 |
574 if (dep_list != NULL) | 572 g_list_free(dep_list); |
575 g_list_free(dep_list); | |
576 | 573 |
577 if (plugin->native_plugin) | 574 if (plugin->native_plugin) |
578 { | 575 { |
579 if (plugin->info != NULL && plugin->info->load != NULL) | 576 if (plugin->info != NULL && plugin->info->load != NULL) |
580 { | 577 { |
784 | 781 |
785 g_free(plugin); | 782 g_free(plugin); |
786 return; | 783 return; |
787 } | 784 } |
788 | 785 |
789 if (plugin->info != NULL && plugin->info->dependencies != NULL) | 786 if (plugin->info != NULL) |
790 g_list_free(plugin->info->dependencies); | 787 g_list_free(plugin->info->dependencies); |
791 | 788 |
792 if (plugin->native_plugin) | 789 if (plugin->native_plugin) |
793 { | 790 { |
794 if (plugin->info != NULL && plugin->info->type == GAIM_PLUGIN_LOADER) | 791 if (plugin->info != NULL && plugin->info->type == GAIM_PLUGIN_LOADER) |