[evolution-data-server/openismus-work] e-test-server-utils: Destroy dynamic closures
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work] e-test-server-utils: Destroy dynamic closures
- Date: Wed, 20 Feb 2013 11:05:31 +0000 (UTC)
commit d2472ee60109674efcfcfe49b4bc30942295c992
Author: Mathias Hasselmann <mathias openismus com>
Date: Thu Feb 7 18:28:57 2013 +0100
e-test-server-utils: Destroy dynamic closures
Adds a callback to the closure structure that describes
its concept of self-destruction.
Conflicts:
tests/test-server-utils/e-test-server-utils.h
tests/test-server-utils/e-test-server-utils.c | 6 +++++-
tests/test-server-utils/e-test-server-utils.h | 2 ++
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/tests/test-server-utils/e-test-server-utils.c b/tests/test-server-utils/e-test-server-utils.c
index 37b605c..ced66dc 100644
--- a/tests/test-server-utils/e-test-server-utils.c
+++ b/tests/test-server-utils/e-test-server-utils.c
@@ -359,8 +359,12 @@ e_test_server_utils_teardown (ETestServerFixture *fixture,
}
/* Cleanup work directory */
- if (!test_installed_services ())
+ if (!closure->keep_work_directory && !test_installed_services ())
delete_work_directory ();
+
+ /* Destroy dynamically allocated closure */
+ if (closure->destroy_closure_func)
+ closure->destroy_closure_func (closure);
}
gint
diff --git a/tests/test-server-utils/e-test-server-utils.h b/tests/test-server-utils/e-test-server-utils.h
index 8a51fe4..8dd7ede 100644
--- a/tests/test-server-utils/e-test-server-utils.h
+++ b/tests/test-server-utils/e-test-server-utils.h
@@ -91,6 +91,8 @@ struct _ETestServerClosure {
ETestServiceType type;
ETestSourceCustomizeFunc customize;
gint calendar_source_type;
+ gboolean keep_work_directory;
+ GDestroyNotify destroy_closure_func;
};
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]