[libpeas] Fix disabling a loader multiple times
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Fix disabling a loader multiple times
- Date: Wed, 9 Feb 2011 00:15:01 +0000 (UTC)
commit dc9e93340cfb93525f7b2300b8321b357172696c
Author: Garrett Regier <alias301 gmail com>
Date: Sun Feb 6 03:59:14 2011 -0800
Fix disabling a loader multiple times
libpeas/peas-engine.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 2e5b8d2..9aecbe7 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -683,7 +683,7 @@ peas_engine_disable_loader (PeasEngine *engine,
loader_info = (LoaderInfo *) g_hash_table_lookup (engine->priv->loaders,
loader_id);
- if (loader_info != NULL)
+ if (loader_info != NULL && loader_info->module != NULL)
{
g_warning ("Loader '%s' cannot be disabled as it is already loaded",
loader_id);
@@ -692,7 +692,8 @@ peas_engine_disable_loader (PeasEngine *engine,
/* By adding a NULL loader, we simulate a failed load attempt, effectively
* disabling the loader for further use. */
- add_loader (engine, loader_id, NULL, NULL);
+ if (loader_info == NULL)
+ add_loader (engine, loader_id, NULL, NULL);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]