[libpeas] Check that the plugin is loaded before creating an extension
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Check that the plugin is loaded before creating an extension
- Date: Wed, 9 Feb 2011 00:14:51 +0000 (UTC)
commit 7b82c470e7429d9f123feef2d8da1801e3ad4132
Author: Garrett Regier <alias301 gmail com>
Date: Sun Feb 6 03:13:17 2011 -0800
Check that the plugin is loaded before creating an extension
This also fixes a test that was disguised as a resident modules issue.
libpeas/peas-engine.c | 1 +
tests/libpeas-gtk/plugin-manager.c | 4 +++-
tests/libpeas/testing/testing-extension.c | 5 +----
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index a1a0530..2e5b8d2 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -943,6 +943,7 @@ peas_engine_create_extensionv (PeasEngine *engine,
g_return_val_if_fail (PEAS_IS_ENGINE (engine), NULL);
g_return_val_if_fail (info != NULL, NULL);
+ g_return_val_if_fail (peas_plugin_info_is_loaded (info), NULL);
loader = get_plugin_loader (engine, info);
return peas_plugin_loader_create_extension (loader, info, extension_type,
diff --git a/tests/libpeas-gtk/plugin-manager.c b/tests/libpeas-gtk/plugin-manager.c
index df6e38c..f8e6634 100644
--- a/tests/libpeas-gtk/plugin-manager.c
+++ b/tests/libpeas-gtk/plugin-manager.c
@@ -330,10 +330,12 @@ test_gtk_plugin_manager_configure_dialog (TestFixture *fixture)
info = peas_engine_get_plugin_info (fixture->engine, "configurable");
+ peas_engine_load_plugin (fixture->engine, info);
+
testing_get_iter_for_plugin_info (fixture->view, info, &iter);
gtk_tree_selection_select_iter (fixture->selection, &iter);
- /* Must be first so we the window is added to the window group */
+ /* Must be first so the window is added to the window group */
gtk_button_clicked (GTK_BUTTON (fixture->configure_button));
window = find_window_by_title (GTK_WINDOW (fixture->window), "Configurable");
diff --git a/tests/libpeas/testing/testing-extension.c b/tests/libpeas/testing/testing-extension.c
index d54b797..354e3db 100644
--- a/tests/libpeas/testing/testing-extension.c
+++ b/tests/libpeas/testing/testing-extension.c
@@ -100,12 +100,9 @@ testing_extension_create_invalid_ (PeasEngine *engine)
extension = peas_engine_create_extension (engine, info,
INTROSPECTION_TYPE_CALLABLE,
NULL);
- /* Resident Modules */
- g_object_unref (extension);
exit (0);
}
- /* Resident modules cause this to fail?
- g_test_trap_assert_failed ();*/
+ g_test_trap_assert_failed ();
g_assert (peas_engine_load_plugin (engine, info));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]