projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3533f8
)
python: Fixed a crash if the plugin was loaded but not configured.
author
Sven Trenkel
<collectd@semidefinite.de>
Mon, 3 May 2010 13:01:56 +0000
(15:01 +0200)
committer
Sven Trenkel
<collectd@semidefinite.de>
Mon, 3 May 2010 13:01:56 +0000
(15:01 +0200)
src/python.c
patch
|
blob
|
history
diff --git
a/src/python.c
b/src/python.c
index
d750d95
..
7a92b48
100644
(file)
--- a/
src/python.c
+++ b/
src/python.c
@@
-828,6
+828,11
@@
static int cpy_init(void) {
static pthread_t thread;
sigset_t sigset;
+ if (!Py_IsInitialized()) {
+ WARNING("python: Plugin loaded but not configured.");
+ plugin_unregister_shutdown("python");
+ return 0;
+ }
PyEval_InitThreads();
/* Now it's finally OK to use python threads. */
for (c = cpy_init_callbacks; c; c = c->next) {